b) Explain with the help of an example/diagram or write code for the following using JSP:
a) The role of action elements in JSP with the help of an example of <jsp:usebean)
The action tags are used to control the flow between pages and to use Java Bean.
jsp:forward forwards the request and response to another resource.
jsp:include includes another resource.
jsp:useBean creates or locates bean object.
jsp:setProperty sets the value of property in bean object.
jsp:getProperty prints the value of property of the bean.
jsp:plugin embeds another components such as applet.
jsp:param sets the parameter value. It is used in forward and include mostly.
jsp:fallback can be used to print the message if plugin is working. It is used in jsp:plugin
Syntax of jsp:useBean action tag:
example:
<jsp:useBean id="u" class="org.sssit.User"></jsp:useBean> Â
<jsp:setProperty property="*" name="u"/> Â
 Â
Record:<br>Â Â
<jsp:getProperty property="name" name="u"/><br> Â
<jsp:getProperty property="password" name="u"/><br> Â
<jsp:getProperty property="email" name="u" /><br> Â
Comments
Leave a comment