j2ee: JSP Actions [14/20] ![]() ![]() ![]() |
Special tags that affect the out stream and use, modify, or create objects
Standard Actions
<jsp:forward> <jsp:include> <jsp:param> <jsp:plugin> <jsp:params> <jsp:fallback> <jsp:useBean> <jsp:getProperty> <jsp:setProperty> <jsp:attribute> <jsp:element> <jsp:body> <jsp:invoke> <jsp:doBody> <jsp:text> <jsp:output>
The last 7 will be discussed once we learn about custom tag libraries
Custom actions: created with tag libraries
forward
Syntax : <jsp:forward page="relativeURLspec" />
<% String dest = "/location/"+someValue; %>
<jsp:forward page='<%= dest %>' />
include
Syntax:
<jsp:include page="urlSpec" flush="true|false"/>
and
<jsp:include page="urlSpec" flush="true|false"> { <jsp:param .... /> }* </jsp:include>
Include a resource at request time, or a request with parameters
param
Used with include and foward and params elements
Syntax:
<jsp:param name="name" value="value" />
plugin
replaces the tag with either an <object> or <embed> tag as needed by the user agent to display an applet or similar plugin properly. The params and fallback actions are used to provide for passing parameters to the plugin and providing feedback to the user if the plugin failed to load.
Example:
<jsp:plugin type=applet code="Molecule.class" codebase="/html" > <jsp:params> <jsp:param name="molecule" value="molecules/benzene.mol"/> </jsp:params> <jsp:fallback> <p> unable to start plugin </p> </jsp:fallback> </jsp:plugin>