JSTL c:catch Core Tag

The JSTL <c:catch> Core Tag is used in exception handling to catch any Throwable object in its body. Syntax: <c:catch var ="variableName"> //exception code </c:catch><c:catch var ="variableName"> //exception code </c:catch> c:catch tag attributes: Attribute Description Required var It specify the name of the variable to hold the java.lang.Throwable if thrown by elements in the body. … Read more

Categories JSP

JSTL c:remove Core Tag

The JSTL <c:remove> Core Tag is used to remove a variable from a specific scope. Syntax: <c:remove var=”varName”/> c:remove tag attributes: Attribute Description Required var It specify the name of the variable to be removed. Yes scope It specify the scope of the variable to be removed. No Example: test.jsp <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> … Read more

Categories JSP

JSTL c:set Core Tag

The JSTL <c:set> Core Tag is used to set a value to a variable or object in a specific scope like session. It works like setProperty action but the difference is that it can take a expression as an input, evaluate it and assign result to a variable or object. Syntax: <c:set var=”varName” value=”value/expression” /> … Read more

Categories JSP

JSTL c:out Core Tag

The JSTL <c:out> Core Tag is used to display the value of an expression to the client’s browser. It works same as of &lt Syntax: <c:out value=”value/expression” /> c:out tag attributes: Attribute Description Required value Information to output Yes default Fallback information to output No escapeXml True if the tag should escape special XML characters … Read more

Categories JSP

JSTL Core Tags

The JSTL core tags are used for iteration, condition checking, URL management etc. Core tags are most commonly used. Syntax: &lt JSTL Core tags are given below: JSTL Core Tags with example. JSTL c:out Core Tag with example. JSTL c:set Core Tag with example. JSTL c:remove Core Tag with example. JSTL c:catch Core Tag with … Read more

Categories JSP

JSTL (JSP Standard Tag Library)

JSTL stands for JSP Standard Tag Library. It provides the no. of tags used for iteration, condition checking, manipulating XML documents etc. Advantages of JSTL: Code reusability. Scriplet tags are not needed. Types of JSTL tags: JSTL Core Tags JSTL Formatting tags JSTL SQL tags JSTL XML tags JSTL Functions   1. JSTL Core Tags: … Read more

Categories JSP

Exception handling in JSP

Exception handling is a mechanism to handle runtime errors, so that normal flow of the program can be maintained. Ways of exception handling in JSP: Using page directive (errorPage and isErrorPage attributes). Using <error-page> attribute of web.xml. Exception handling example using errorPage and isErrorPage attributes: welcome.jsp <%@ page errorPage="errorPage.jsp" %>   <html> <head> <title>isErrorPage and … Read more

Categories JSP

jsp:useBean, jsp:setProperty and jsp:getProperty action tag

jsp:useBean action tag: jsp:useBean action tag is used to instantiate a bean class. It first search for an existing instance using id and scope variables. If object is not found than it creates bean class object. Commonly used attributes of jsp:useBean: 1. id: This attribute is used to uniquely identify the bean class within the … Read more

Categories JSP

jsp:param action tag

The jsp:param action tag is used pass the parameters from JSP to other resource like jsp or servlet. Syntax: <jsp: param name=”paramName” value=”paramValue”/> Example: welcome.jsp <html> <head> <title>param action example</title> </head> <body> <h3>Hello this is a param action example.</h3> <jsp:forward page="home.jsp"> <jsp:param name="websiteName" value="826.a00.myftpupload.com"/> </jsp:forward> </body> </html><html> <head> <title>param action example</title> </head> <body> <h3>Hello this … Read more

Categories JSP

jsp:include action tag

jsp:include action tag is used to include the content of another resource at the specific position into current JSP page. Another resource can be servlet, jsp or html file. Syntax: <jsp:include page=”URL of another resource”/> Note: In case of jsp:include action tag contents are included during request processing. Difference between include directive and include action. … Read more

Categories JSP