Standard Action Tags In JSP
Standard Action Tags In JSP are meant for performing some action at run time. As the name of the tag itself suggests these tags are used for run time behavior. Unlike scripting tags which are meant for generating related servlet code at the time of translation,Standard Action Tags In JSP generates code for run time behavior.
Examples of Standard Action Tags In JSP are as follows :
- <jsp:include file= ”AnotherJsp.jsp”/>
- <jsp:forward file=”AnotherJsp.jsp”/>
- <jsp:useBean id=”obj” type=”SomeBean” class=”SomeBean” scope=”request”>
- <c:set var=”attrName” value=”attrVal” scope=”request”/>
There are so many other tags as well amongst which these are some and important.
Let us take these tags individually as see how do they contribute for Standard Action Tags In JSP
- <jsp:include file= ”AnotherJsp.jsp”/> : This tag is used for run time inclusion of another JSP page in an existing one. This inclusion is not similar to inclusion with include directive. Include directives are meant for static inclusion. This means that the code from the included JSP will be included int the including JSP at the translation time. But in the case of <jsp:include file= ”AnotherJsp.jsp”/> tag a run time call to the included JSP is done and the response from the included JSP is added to the response of the including JSP.
- <jsp:forward file=”AnotherJsp.jsp”/> : This tag is used for forwarding the request to another JSP at run time. The difference here from run time or dynamic inclusion is that here the response from the forwarded JSP only goes to the user and the response from the first JSP from where the forward happens gets flushed out.
- <jsp:useBean id=”obj” type=”SomeBean” class=”SomeBean” scope=”request”> : This tag is used to create or fetch a java bean object ,set or get its property value/s and retrieve or set this java bean object in certain scope.
- <c:set var=”attrName” value=”attrVal” scope=”request”/> : This tag is used to set an attribute in a particular scope.This is an important tag as our MVC applications rely heavily on attributes
Related posts:
- Explain Different Types Of Tags In JSP Interview Asked Questions And Answers
- Declare Servlet Init Parameters For JSP Page In web.xml File JSP Initialization FAQ
- Basic Servlet Attributes Thread Safety Interview Questions Answers Explained
- How To Get Servlet Init Parameters In JSP
- A Hello,World Servlet Servlet Tutorial Servlet Examples Run servlet on tomcat
Tags: j2ee, java, jsp, scripting tag, servlet, standard action
This entry was posted on Friday, May 25th, 2012 at 12:21 am and is filed under Java, OPPS, software, Tech-Tips, Tips & Tricks. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.