JSP Action Tags & JSTL (JSP Standard Tag Library)

The list of standard JSP action elements are given below.+
JSP ACTIONDESCRIPTION
jsp:includeTo include a resource at runtime, can be HTML, JSP or any other file
jsp:useBeanTo get the java bean object from given scope or to create a new object of java bean.
jsp:getPropertyTo get the property of a java bean, used with jsp:useBean action.
jsp:setPropertyTo set the property of a java bean object, used with jsp:useBean action.
jsp:forwardTo forward the request to another resource.
jsp:textTo write template text in JSP page.
jsp:elementTo define the XML elements dynamically.
jsp:attributeTo define the dynamically generated XML element attributes
jsp:bodyTo define the dynamically generated XML element body
jsp:pluginTo generate the browser-specific code that makes an OBJECT or EMBED tag for the Java plugin.
Out my experience I can tell that, we mostly use jsp:include, jsp:useBean and jsp:forward actions. jsp:setProperty and jsp:getProperty are used in jsp:useBean so I will just focus on this actions. Others are not so important from both interview perspective as well as from project development perspective. You can safely ignore it ðŸ™‚+
 +
 include directive  jsp:include action
Including the file happens at Translation TimeIncluding the file happens at Runtime
A copy of the original file is copiedNo copy of the original file created but it refers to the  original file
Meant for static contentMeant for dynamic content
Cannot pass parametersCan pass parameters
A copy of the original file is copiedNo copy of the original file created but it refers to the  original file
 +
 +
 +
 +
JSTL+
 +

JSTL Core Tags List

TagsDescription
c:outIt display the result of an expression, similar to the way <%=…%> tag work.
c:importIt Retrives relative or an absolute URL and display the contents to either a String in ‘var’,a Reader in ‘varReader’ or the page.
c:setIt sets the result of an expression under evaluation in a ‘scope’ variable.
c:removeIt is used for removing the specified scoped variable from a particular scope.
c:catchIt is used for Catches any Throwable exceptions that occurs in the body.
c:ifIt is conditional tag used for testing the condition and display the body content only if the expression evaluates is true.
c:choose, c:when, c:otherwiseIt is the simple conditional tag that includes its body content if the evaluated condition is true.
c:forEachIt is the basic iteration tag. It repeats the nested body content for fixed number of times or over collection.
c:forTokensIt iterates over tokens which is separated by the supplied delimeters.
c:paramIt adds a parameter in a containing ‘import’ tag’s URL.
c:redirectIt redirects the browser to a new URL and supports the context-relative URLs.
c:urlIt creates a URL with optional query parameters.

Comments

Popular posts from this blog

IntelliJ IDEA 2016 — 2017 Activation

Java Beginners Tutotrial

SQL3