1 / 13

JSP Standard Actions

JSP Standard Actions. Celsina Bignoli bignolic@smccd.net. JSP Standard Actions. The JSP specification defines a few standard action elements (built-in in JSP) The syntax: <jsp:action-name attr1=“value1” attr2=“value2”> action_body </jsp:action-name> or (with no body)

lajos
Download Presentation

JSP Standard Actions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. JSP Standard Actions Celsina Bignoli bignolic@smccd.net

  2. JSP Standard Actions • The JSP specification defines a few standard action elements (built-in in JSP) • The syntax: <jsp:action-name attr1=“value1” attr2=“value2”> action_body </jsp:action-name> • or (with no body) <jsp: action-name attr1=“value1” attr2=“value2” />

  3. JSP Standard Actions - Example <jsp:forward page=“nextPage.jsp”> <jsp:param name=“aParam” value=“aValue” /> </jsp:forward> <jsp:forward page=“nextPage.jsp” />

  4. Standard Actions - Listing

  5. <jsp:forward> • passes control to another JSP page or servlet • the execution of the current JSP page is terminated and control is fully passed to the target JSP • Syntax 1: <jsp:forward page=“pagePath” /> • Syntax 2: <jsp:forward page=“pagePath” > <one or more <jsp:param> actions </jsp:forward>

  6. <jsp:include> • includes the response of another JSP page, servlet or static file • the execution of the current JSP page continues after including the response generated by the target resource • the target resource has access to all the parameters and headers passed with the request. • Additional parameters can be passed using <jsp:param> actions in the body of <jsp:include> • Syntax 1: <jsp:include page=“pagePath” /> • Syntax 2: <jsp:include page=“pagePath” > <one or more <jsp:param> actions </jsp:include>

  7. <jsp:plugin> • used to download Java Plugin software and invoke a Java applet • Syntax: <jsp:plugin type=“applet” code=“Code.class” codebase=“relativePath” [jreversion=“jreVersion] [height=“height”] [width=“width”] [hspace=“hSpace”] [vSpace=“vspace”] [iepluginurl=“pluginURL”] [nspluginurl=“pluginURL”] [name=“name”][title=“title”] > Optionally one <jsp:params> action and one <jsp:fallback> action </jsp:plugin>

  8. <jsp:params> • can only be used within the body of a <jsp:plugin> action to enclose a set of <jsp:param> actions that specify the applet parameters • Syntax: <jsp:params> One or more <jsp:param> action </jsp:params>

  9. <jsp:fallback> • can only be used within the body of a <jsp:plugin> • Specifies the template text to use for browser that don’t support the <html> or <object> elements • Syntax: <jsp:fallback> Fallback body </jsp:fallback>

  10. <jsp:plugin> - Example <jsp:plugin type=“applet” code=“Clock2.class” codebase=“applet” jreversion=“1.2” width=“160” height=“160” > <jsp:params> <jsp:param name=“bgcolor” value=“cc00ff” /> </jsp:params> <jsp:fallback> Plugin tag OBJECT or EMBED not supported by the browser </jsp:fallback> </jsp:plugin>

  11. <jsp:attribute> • defines an attribute value for another jsp action • Syntax: <jsp:attribute name=“attrName” > Attribute value </jsp:attribute>

  12. <jsp:body> • defines the body for an action element • Only required when the action attributes are defined using <jsp:attribute> • Syntax: <jsp:body> Body content </jsp:body>

  13. <jsp:body> - Example <jsp:plugin type=“applet” code=“Clock2.class” codebase=“applet” jreversion=“1.2”> <jsp:attribute name=“width”>160</jsp:attribute> <jsp:attribute name=“height”>160</jsp:attribute> <jsp:body> <jsp:params> <jsp:param name=“bgcolor” value=“cc00ff” /> </jsp:params> <jsp:fallback> Plugin tag OBJECT or EMBED not supported by the browser </jsp:fallback> </jsp:body> </jsp:plugin>

More Related