Answer to Question #259128 in HTML/JavaScript Web Application for pooja

Question #259128

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)



1
Expert's answer
2021-11-04T00:23:52-0400

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:

  1. <jsp:useBean id= "instanceName" scope= "page | request | session | application"   
  2. class= "packageName.className" type= "packageName.className"  
  3. beanName="packageName.className | <%= expression >" >  
  4. </jsp:useBean>  


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>  

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS