jsp:forward action tag

jsp:forward action tag is used for controlling the page flow. It forwards the request from a JSP to the other resource. Another resource can be servlet, jsp or html file. Syntax: <jsp:forward page=”URL of other resource”/> Example: welcome.jsp <html> <head> <title>forward action example</title> </head> <body> <jsp:forward page="home.jsp"/> </body> </html><html> <head> <title>forward action example</title> </head> <body> … Read more

Categories JSP

JSP action tags

JSP specification provides the action tags to control the behaviour of the servlet engine, to control page flow, to dynamically insert a file, to reuse JavaBeans components etc. jsp: is used as prefix. Syntax: <jsp:actionName attributeName=”attributeValue”/> Commonly used JSP action tags are as follows: jsp:forward jsp:include jsp:param jsp:useBean jsp:setProperty jsp:getProperty Common attributes of all action … Read more

Categories JSP

JSP exception implicit object

JSP exception object is an instance of javax.servlet.jsp.JspException. This object is used in exception handling to print the error message. But is only be used on that jsp page on which isErrorPage attribute is true. Example: welcome.jsp <html> <head> <title>Exception handling example</title> </head> <body> <% out.print(10/0); %> </body> </html><html> <head> <title>Exception handling example</title> </head> <body> … Read more

Categories JSP

JSP page implicit object

JSP page object is an instance of java.lang.Object. As we discussed earlier that JSP is translated into servlet by web container. JSP page object refers the instance of this servlet. It acts as a synonym for this object. As it represents the servlet, it must be cast to HttpServlet. this can also be used directly … Read more

Categories JSP

JSP pageContext implicit object

JSP pageContext object is an instance of javax.servlet.jsp.PageContext. This object is used to manipulate page, request, application and session attributes. Example: login.jsp <html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html><html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html> … Read more

Categories JSP

JSP session implicit object

JSP session object is an instance of javax.servlet.http.HttpSession. This object is used to for session tracking or session management. Example: login.jsp <html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html><html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html> welcome.jsp … Read more

Categories JSP

JSP application implicit object

JSP application object is an instance of javax.servlet.ServletContext. This object is used to get initialization parameters defined in web.xml. Example: index.jsp <html> <head> <title>application implicit object example</title> </head> <body> <h3>To see the website name click on the below link.</h3> <a href="welcome.jsp">Click here</a> </body> </html><html> <head> <title>application implicit object example</title> </head> <body> <h3>To see the website … Read more

Categories JSP

JSP config implicit object

JSP config object is an instance of javax.servlet.ServletConfig. This object is used to get the configuration information about a page like servlet name, servlet context, configuration parameters etc. Example: index.jsp <html> <head> <title>config implicit object example</title> </head> <body> <h3>To see the website name click on the below link.</h3> <a href="welcome.jsp">Click here</a> </body> </html><html> <head> <title>config … Read more

Categories JSP

JSP response implicit object

JSP response object is an instance of javax.servlet.http.HttpServletResponse. It is mainly used to modify the response. Example: login.jsp <html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html><html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html> welcome.jsp <html> <head> <title>response … Read more

Categories JSP

JSP request implicit Object

JSP request Object is the instance of javax.servlet.http.HttpServletRequest. This object is used to get the HTTP header information, data entered on previous JSP page etc. Example: login.jsp <html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html><html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input … Read more

Categories JSP