{"id":326,"date":"2018-07-27T09:34:55","date_gmt":"2018-07-27T09:34:55","guid":{"rendered":"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=326"},"modified":"2018-08-02T08:51:05","modified_gmt":"2018-08-02T08:51:05","slug":"jsp-ii","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/chapter\/jsp-ii\/","title":{"rendered":"JSP \u2013 II"},"content":{"raw":"<div>\r\n\r\n<strong>1. JSPElements \u2013 JSP Actions<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Let us explore the JSP Action elements first. Actions are high-level JSP elements which are used to create, modify or use other JSP objects. Unlike directives and scripting elements, JSP actions are coded using strict XML syntax form. By using of JSP action elements we can dynamically insert a file, reuse JavaBeans components, forward the user to another page, or generate HTML for the Java plugins etc.Usage of syntax for the Action element, is given below as it conforms to the XML standard:<\/p>\r\n&nbsp;\r\n\r\n&lt;jsp:action_name attribute=\"value\" \/&gt;\r\n\r\nAction elements are basically predefined functions and the following JSP actions are available for use:\r\n\r\n&lt;jsp:param&gt;,\u00a0\u00a0 &lt;jsp:include&gt;,\u00a0\u00a0\u00a0 &lt;jsp:forward&gt;,\u00a0\u00a0\u00a0 &lt;jsp:fallback&gt;,\u00a0\u00a0\u00a0 &lt;jsp:plugin&gt;,\u00a0\u00a0\u00a0 &lt;jsp:useBean&gt;,\r\n\r\n&lt;jsp:setProperty&gt;,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;jsp:getProperty&gt;\r\n\r\nLet us explore the element tags one by one,\r\n\r\n&nbsp;\r\n\r\n<strong>1.1 JSP Elements: JSP Actions (param)<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The &lt;jsp:param&gt; action is basically used to provide information in the form of name value pairs to the current request. This action can also be used in alongwith jsp:include, jsp:forward andjsp:pluginactions. The syntax of jsp:param is<\/p>\r\n&nbsp;\r\n\r\n&lt;jsp:param name=\u201dparameter_name\u201d value=\u201dparameter_value\u201d \/&gt;\r\n\r\n&nbsp;\r\n\r\nExample for jsp:param tag is:\r\n\r\n&nbsp;\r\n\r\n&lt;jsp: include page \u201cprocess.jsp\u201d&gt; &lt;jsp:param name = \u201cuser\u201d value = \u201cmona\u201d\/&gt; &lt;jsp:param name = \u201csessionid\u201d value = \u201c1234D3F\u201d\/&gt;\r\n\r\n&lt;\/jsp:include&gt;\r\n\r\n<\/div>\r\n&nbsp;\r\n\r\n<strong>1.2 JSP Elements: JSP Actions (include)<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The jsp:include action tag is used to include the content of other resources such as a jsp, html or servlet file in a JSP page. The jsp:include tag can also be used to include static as well as dynamic pages. The jsp include action tag tries to include the resources at the request time and it is a good opinion for dynamic pages. The advantage of jsp: include is code reusability where we can make of use a page number of times.For example we can use jsp include action tag for including header and footer pages in all the pages. This may save a lots of time.<\/p>\r\n&nbsp;\r\n\r\nSyntax of jsp:include action tag without parameter is:\r\n\r\n&lt;jsp:include page=\"relativeURL | &lt;%= expression %&gt;\" \/&gt;\r\n\r\nSyntax of jsp:include action tag with parameter is:\r\n\r\n&lt;jsp:include page=\"relativeURL | &lt;%= expression %&gt;\"&gt;\r\n\r\n&lt;jsp:param name=\"parametername\" value=\"parametervalue | &lt;%=expression%&gt;\" \/&gt; &lt;\/jsp:include&gt;\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">An example of jsp:include action tag without parameter is given below.In this example, index.jsp file includes the content of the printdate.jsp file.<\/p>\r\n&nbsp;\r\n\r\nFile: index.jsp\r\n\r\n&nbsp;\r\n\r\n&lt;h2&gt;this is index page&lt;\/h2&gt;\r\n\r\n&lt;jsp:include page=\"printdate.jsp\" \/&gt;\r\n\r\n&lt;h2&gt;end section of index page&lt;\/h2&gt; File: printdate.jsp\r\n\r\n&lt;% out.print (\"Today is:\"+java.util.Calendar.getInstance ().getTime ()); %&gt;\r\n\r\nNow the difference betweenjsp:include and include directive used in JSPshould be known. This is explained in Table 1.\r\n\r\n&nbsp;\r\n\r\nTable 1. Comparison between jsp:include and include directive\r\n\r\n&nbsp;\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-327 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-202.png\" alt=\"\" width=\"618\" height=\"208\" \/><\/p>\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-328 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-203.png\" alt=\"\" width=\"622\" height=\"177\" \/><\/p>\r\n&nbsp;\r\n<div>\r\n\r\n<strong>1.3 JSP Elements: JSP Actions (forward)<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">While we use forward action tag , the current page stops processing the request and forwards the request to another page. After execution forwarding to the new page, execution never returns to the calling or current page.<\/p>\r\n&nbsp;\r\n\r\nSyntax of JSP Action(forward) tag is :\r\n\r\n&lt;jsp:forward page= \u201cfile_name\u201d \/&gt;\r\n\r\nOr it can be also be written as:\r\n\r\n&lt;jsp: forward page= \u201cfile_name\u201d&gt;\r\n\r\n&lt;jsp:param name=\u201dparameter_name\u201d value=\u201dparameter_value\u201d \/&gt;&lt;\/jsp: forward&gt;\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">An example of jsp:forward action tag without parameter is discussed here.In the following example, an attempt has been made to simply forward the request to the print date .jsp file.<\/p>\r\n&nbsp;\r\n\r\n<strong>index.jsp<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;h2&gt;this is index page&lt;\/h2&gt;\r\n\r\n&lt;jsp:forward page=\"printdate.jsp\" \/&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n\r\n&nbsp;\r\n\r\n<strong>1.4JSP Elements: JSP Actions (useBean)<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Usage of beantag through JSP actions instantiates a Java bean object into the JSP page. (UseBeanProperty has been used in two flavors: getProperty and setProperty. jsp:useBean creates a new instance of a bean and its syntax is<\/p>\r\n&nbsp;\r\n\r\n&lt;jsp:useBean id=\u201cobject_Name\" class=\u201cclass name\u201c &gt;\r\n\r\n&nbsp;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">Where id is the name of the object, class is aJavabean class from which the object gets instantiated.<\/span>\r\n\r\n&nbsp;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">This is equivalent to the JSP systax:<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;% class_name object_name = new class_name(); %&gt;<\/span>\r\n\r\n&nbsp;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">Example to instantiate a Factorial bean in a JSP page is given below:<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;jsp:useBean id = \u201cfact\u201d class = \u201cbean.Factorial\u201d\/&gt;<\/span>\r\n\r\n&nbsp;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">This is equivalent to the JSP scriplet<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;% bean.Factorial fact = new bean.Factorial(); %&gt;<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0 <\/strong>\r\n\r\n<strong>1.4.1 JSP Actions (jsp:setProperty)<\/strong>\r\n\r\n&nbsp;\r\n\r\njsp:getProperty reads and outputs the value of a bean property (ie.,calling a getter method) and its syntax is\r\n\r\n&nbsp;\r\n\r\n&lt;jsp:getProperty name=\"beanName\" property=\"propertyName\" \/&gt;\r\n\r\nAn example for gtPropertyis &lt;jsp:getProperty name = \u201cfact\u201d property = \u201cvalue\u201d\/&gt;\r\n\r\nThis is equivalent to JSP Scriplet:\r\n\r\n&lt;%= fact.getValue() %&gt;\r\n\r\n&nbsp;\r\n\r\n<strong>1.4.2 JSP Actions (jsp:setProperty)<\/strong>\r\n\r\n&nbsp;\r\n\r\njsp:setProperty modifies a bean property (by calling a setter method)\r\n\r\n&nbsp;\r\n\r\n&lt;jsp:setProperty\r\n\r\nname=\"beanName\"\r\n\r\nproperty=\"propertyName\u201c\r\n\r\nvalue=\"propertyValue\" \/&gt;\r\n\r\nAn example for Set Property is:\r\n\r\n&lt;jsp: setProperty name=\u201cfact\u201d property = \u201cvalue\u201d value =\u201c5\u201d \/&gt;\r\n\r\nThis is equivalent to the JSP Scriplet:\r\n\r\n&lt;%fact.setValue(5)%&gt;\r\n\r\n&nbsp;\r\n\r\n<strong>2.JSP Implicit Objects<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">JSP implicit objects are created by the container automatically. When a web server processes a JSP page( during the translation of a JSP page to a Servlet source to help developers). These\u00a0<span style=\"text-align: initial;font-size: 1em\">objects can also be used directly in scriptlets that goes in service method. Nine Implicit Objects can be used in a JSP page as discussed below:<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n\u00a0 \u00a0 a) Request object: Request implicit object is to get the data on a JSP page which has been entered by the user in frontend\r\n\r\nString Uid= request.getParameter(\"user-id\");\r\n\r\nString Pass= request.getParameter(\"password\");\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">b) Response Object: This is the HttpServletResponse object associated with the response to the client this is used to send responses to the client.<\/p>\r\n&nbsp;\r\n\r\nresponse.setContentType(\"text\/html\");\r\n\r\nresponse.setContentType(\"image\/gif\");\r\n\r\nresponse.setContentType(\"image\/png\");\r\n\r\nresponse.setContentType(\"application\/pdf\");\r\n\r\n&nbsp;\r\n\r\nc) Session:This is the most frequently used implicit object, which is used for storing the user\u2019s data to make\u00a0\u00a0\u00a0 it available on other JSP pages till the user\u00a0\u00a0\u00a0\u00a0 session is active.\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">d) Out: This is used for writing content to the client(browser). This has several methods which can be used for properly formatting output message to the browser and for dealing with the buffer.<\/p>\r\n&nbsp;\r\n\r\nExample:\r\n\r\n&nbsp;\r\n\r\nout.println(\u201chi\u201d); out.println(\u201chello\u201d);\r\n\r\n&nbsp;\r\n\r\ne) Application:This is used for getting application-wide initialization parameters and to maintain useful data across whole JSP application.\r\n\r\n&nbsp;\r\n\r\nExample:\r\n\r\n&nbsp;\r\n\r\nString s = (String)application.getAttribute(\"MyAttr\");\r\n\r\n&nbsp;\r\n\r\nThis example would return the object stored in the attribute \u201cMyAttr\u201d.\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">f) Exception:This object is used in exception handling for displaying error messages. This object is only available to the JSP pages, whereisErrorPage attribute is set to true.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">g) Page : JSP page implicit object is an instance of java.lang.Object class, which indicates the current JSP page. The Page object provide reference to the generated servlet class.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">h) PageContext Object : This implicit object is an instance of javax.servlet.jsp.PageContextabstract classimplementation. PageContext to get and set attributes with different scopes and to forward request to other resources. PageContext objectccan be used also holds references to other implicit objects.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">i) Config Object : This is used to get the JSP initparamsconfigured in the deployment descriptor.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0 \u00a0<\/strong>\r\n\r\n<strong>2.1 JSP Implicit objects \u2013 Class files (instantiation)<\/strong>\r\n\r\n&nbsp;\r\n\r\nThe JSP Class files which are involved in Implicit objects are defined below:\r\n\r\n&nbsp;\r\n\r\n\u2022\u00a0 application: javax.servlet.ServletContext\r\n\r\n\u2022\u00a0 config: javax.servlet.ServletConfig\r\n\r\n\u2022\u00a0 exception: java.lang.Throwable\r\n\r\n\u2022\u00a0 out: javax.servlet.jsp.JspWriter\r\n\r\n\u2022\u00a0 page: java.lang.Object\r\n\r\n\u2022\u00a0 pageContext: javax.servlet.jsp.PageContext\r\n\r\n\u2022\u00a0 request: javax.servlet.ServletRequest\r\n\r\n\u2022\u00a0 response: javax.servlet.ServletResponse\r\n\r\n\u2022\u00a0 session: javax.servlet.http.HttpSession\r\n\r\n&nbsp;\r\n\r\n<strong>2.2 Example for the JSP Implicit objects<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">To demonstrate the usage of JSP Implicit objects, an example which makes use of Request, Response, Out and session objects has been given below,<\/p>\r\n&nbsp;\r\n\r\n<strong>Index.html<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;title&gt;Login Page&lt;\/title&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;form action=\"checkdetails.jsp\"&gt;\r\n\r\nUserId:&lt;input type=\"text\" name=\"id\" \/&gt;&lt;br&gt;&lt;br&gt; Password: &lt;input type=\"text\" name=\"pass\" \/&gt;&lt;br&gt;&lt;br&gt;\r\n\r\n&lt;input type=\"submit\" value=\"Sign In!!\"\/&gt; &lt;\/form&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n\r\n&nbsp;\r\n\r\nSign in Form: Receiving id and password from User Login page\r\n\r\n&nbsp;\r\n\r\n<strong>checkdetails.jsp<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;title&gt;Check Credentials&lt;\/title&gt;\r\n\r\n&lt;\/head&gt;&lt;body&gt;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;% String uid=<\/span><strong style=\"text-align: initial;font-size: 1em\">request<\/strong><span style=\"text-align: initial;font-size: 1em\">.getParameter(\"id\");<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">String password=<\/span><strong style=\"text-align: initial;font-size: 1em\">request<\/strong><span style=\"text-align: initial;font-size: 1em\">.getParameter(\"pass\");<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">session.setAttribute(\"session-uid\", uid);<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">if(uid.equals(\"Chaitanya\") &amp;&amp;password.equals(\"BeginnersBook\"))<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">{ <\/span><strong style=\"text-align: initial;font-size: 1em\">response<\/strong><span style=\"text-align: initial;font-size: 1em\">.sendRedirect(\"success.jsp\"); }<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">else { <\/span><strong style=\"text-align: initial;font-size: 1em\">response<\/strong><span style=\"text-align: initial;font-size: 1em\">.sendRedirect(\"failed.jsp\"); } %&gt; &lt;\/body&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/html&gt;<\/span>\r\n\r\n&nbsp;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">This JSP page verifies the input id\/pass against hard-coded values.<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0success.jsp<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;title&gt;Success Page&lt;\/title&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;% String data=(String)session.getAttribute (\"session-uid\"); out.println(\"Welcome \"+ data+\"!!\"); %&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n\r\n&nbsp;\r\n\r\nThis JSP page would execute if id\/pass are matched to the hardcoded userid\/password.\r\n\r\n&nbsp;\r\n\r\n<strong>failed.jsp<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;title&gt;Sign-in Failed Page&lt;\/title&gt;\r\n\r\n&lt;\/head&gt;&lt;body&gt;\r\n\r\n&lt;% String data2=(String)session.getAttribute (\"session-uid\");\r\n\r\nout.println(\"Hi \"+ data2+\". Id\/Password are wrong. Please try Again.\"); %&gt; &lt;\/body&gt;\r\n\r\n&lt;\/html&gt;\r\n\r\n&nbsp;\r\n\r\nThe control will be redirected to this page if the credentials entered by user are wrong.\r\n\r\nOutput of JSP page thatreceives id and password andcorrectlyverified is shown in Figure 1.\r\n\r\n<\/div>\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-329 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-204.png\" alt=\"\" width=\"510\" height=\"328\" \/><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">Figure 1Output of JSP page that receive id and password andcorrect verification.<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">If Sign-In has been failed ,when Id and Password provided is are wrong the output is displayed shown in Figure2.<\/span><\/p>\r\n\r\n<div>\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-330 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-205.png\" alt=\"\" width=\"549\" height=\"354\" \/><\/p>\r\n\r\n<\/div>\r\n&nbsp;\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0 3.JSP - Exception Handling<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The exception is normally an object that is thrown during the runtime. Exception Handling is the processused to handle the runtime errors. There may be a possibility that exception may occur at any time in our web application. So handling exceptions is a safer side for the web developers.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">In JSP, there are two ways to perform exception handling, one is by using errorPage and isErrorPage attributes of page directive and the other one is by using&lt;error-page&gt; element in web.xml file.<\/p>\r\n&nbsp;\r\n\r\n<strong>3.1 Example of JSPexception handling using the elements of page directive<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">To demonstrate the usage of JSP Exception Handling, three jsp pages have been designed in this example. Out of which, one page has been defined\/created to handle the exceptions(in this example names error.jsp). Another page is defined with errorPage attribute of page directive.(as defined by the process.jsp page) and one more page is used for getting values.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Define and create a page to handle the exceptions, named error.jsp page, where the possibility of exception may arise, For example : 3 files are designed<\/p>\r\n\r\n<ul>\r\n \t<li>index.jsp for getting input values<\/li>\r\n \t<li>process.jsp for dividing the two numbers and displaying the result<\/li>\r\n \t<li>error.jsp for handling the exception<\/li>\r\n<\/ul>\r\n<strong>\u00a0 \u00a0 \u00a0 index.jsp<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;form action=\"process.jsp\"&gt;\r\n\r\nNo1:&lt;input type=\"text\" name=\"n1\" \/&gt;&lt;br\/&gt;&lt;br\/&gt; No1:&lt;input type=\"text\" name=\"n2\" \/&gt;&lt;br\/&gt;&lt;br\/&gt; &lt;input type=\"submit\" value=\"divide\"\/&gt; &lt;\/form&gt;\r\n\r\n&nbsp;\r\n\r\n<strong>process.jsp<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;%@ page errorPage=\"error.jsp\" %&gt;\r\n\r\n&lt;%\r\n\r\nString num1=request.getParameter(\"n1\");\r\n\r\nString num2=request.getParameter(\"n2\");\r\n\r\nint a=Integer.parseInt(num1);\r\n\r\nint b=Integer.parseInt(num2);\r\n\r\nint c=a\/b;\r\n\r\nout.print(\"division of numbers is: \"+c);\r\n\r\n%&gt;\r\n\r\n&nbsp;\r\n\r\n<strong>error.jsp<\/strong>\r\n\r\n<\/div>\r\n<div>\r\n\r\n\u00a0 \u00a0&lt;%@ page isErrorPage=\"true\" %&gt;\r\n\r\n&lt;h3&gt;Sorry an exception occured!&lt;\/h3&gt;\r\n\r\nException is: &lt;%= exception %&gt;\r\n\r\nOutput of this example is given in Figure 3 and Figure 4.\r\n\r\n&nbsp;\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-331 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-206.png\" alt=\"\" width=\"526\" height=\"514\" \/><\/p>\r\n&nbsp;\r\n\r\n<strong>5.\u00a0\u00a0<\/strong><strong>JSP Session Tracking<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">In a web application, server may be responding to several clients at a time. Hence, so session tracking is a way by which a server can identify the client uniquely.As we know HTTP\u00a0<span style=\"text-align: initial;font-size: 1em\">protocol is stateless which means client needs to open a separate connection every time it interacts with server and server treats each request as a new request. In order to identify the client, server needs to maintain the state and to do so, there are several session tracking techniques. They are listed below:<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0<\/strong>\r\n\r\n<strong> 5.1 Session Tracking Techniques<\/strong>\r\n\r\n&nbsp;\r\n\r\nSession Tracking has following fields:\r\n\r\n&nbsp;\r\n\r\n\u2022 Hidden fields\r\n\r\n\u2022 URL rewriting\r\n\r\n\u2022 Cookies\r\n\r\n\u2022 Session Objects\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">With Cookies, Hidden Fields and URL rewriting approaches, client always sends a unique identifier with each request and server determines the user session based on that unique identifier whereas in the session tracking approach using Session Object it uses all the other three techniques internally.<\/p>\r\n&nbsp;\r\n\r\n<strong>5.2 Session tracking using Cookies:<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Out of the four session tracking techniques, session tracking using cookie has been discussed here, If cookie is associated with the client request, server will associate it with corresponding user session otherwise it will create a new unique cookie and send it back with response. Cookie objects are can be created using a name value pair.For example we can create a cookie with the name sessionId and with a unique value for each client. Later this can be added it in a response so that it will be sent back to the client.<\/p>\r\n&nbsp;\r\n\r\nSyntax of creating Cookie in a JSP is:\r\n\r\n&nbsp;\r\n\r\nCookie cookie = new Cookie(\u201csessionID\u201d, \u201csome unique value\u201d); response.addCookie(cookie);\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The following examples illustrate the usage of cookie1.jsp is used to accept the username. Cookie2.jsp creates and sets a cookie with maximum age, whereas cookie3.jsp file is used to display the values of the cookies.<\/p>\r\n&nbsp;\r\n\r\n<strong>cookie1.jsp:<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;html&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;form method = \"post\" action=\"cookie2.jsp\"&gt; &lt;font&gt;Username&lt;input type = \"text\" name = \"name\"&gt;&lt;\/font&gt; &lt;\/font&gt;&lt;br&gt;\r\n\r\n&lt;input type = \"submit\" name = \"submit\" value = \"submit\" &gt;\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/form&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/body&gt;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">&lt;\/html&gt;<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0<\/strong>\r\n\r\n<strong> cookie2.jsp:<\/strong>\r\n\r\n&nbsp;\r\n\r\n&lt;%@ page language=\"java\" import=\"java.util.*\"%&gt; &lt;% String name=request.getParameter(\"name\"); Cookie cookie = new Cookie (\"name\",name); response.addCookie(cookie); cookie.setMaxAge(50 * 50); \/\/Time is in Minutes%&gt;\r\n\r\n&lt;a href=\"cookie3.jsp\"&gt;Continue&lt;\/a&gt;\r\n\r\ncookie3.jsp:\r\n\r\n&lt;p&gt;Display the value of the Cookie&lt;\/p&gt;\r\n\r\n&lt;%\r\n\r\nCookie[] cookies = request.getCookies();\r\n\r\nfor (inti=0; i&lt;cookies.length; i++)\r\n\r\n{\r\n\r\nif(cookies[i].getName().equals(\"name\"))\r\n\r\nout.println(\"Hello\"+cookies[i].getValue());\r\n\r\n}\r\n\r\n%&gt;\r\n<p style=\"text-align: justify\">With respect to the above code, output of Cookie1.jsp, Cookie2.jsp and Cookie3.jsp has been shown in the figures 5, 6, 7 respectively.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"size-full wp-image-332 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-207.png\" alt=\"\" width=\"457\" height=\"180\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 4. Output of Cookie1.jsp<\/strong><\/p>\r\n\r\n<\/div>\r\n<p style=\"text-align: center\"><img class=\"size-full wp-image-333 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-208.png\" alt=\"\" width=\"498\" height=\"462\" \/><\/p>\r\n\r\n<div>\r\n\r\n<strong>\u00a0 \u00a0Summary<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">This Chapter illustrated the usage of JSP action tags with its various types and formats.This Chapter has also demonstrated the usage of various implicit objects with suitable examples. Later the usage of cookies in session tracking has also been dealt.<\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>Web Links<\/strong>\r\n<ul>\r\n \t<li>http:\/\/www.fas.harvard.edu\/~cscie259\/lectures\/<\/li>\r\n \t<li><a href=\"http:\/\/docs.oracle.com\/cd\/E21764_01\/web\">http:\/\/docs.oracle.com\/cd\/E21764_01\/web<\/a><\/li>\r\n \t<li><a href=\"http:\/\/www.cse.buffalo.edu\/faculty\/bina\/gridforce\/586.htm\">http:\/\/www.cse.buffalo.edu\/faculty\/bina\/gridforce\/586.htm<\/a> <a href=\"http:\/\/docs.oracle.com\/cd\/E21764_01\/web\">http:\/\/docs.oracle.com\/cd\/E21764_01\/web<\/a><\/li>\r\n \t<li><a href=\"http:\/\/javatyro.blogspot.com\/2013\/07\/jsp\">http:\/\/javatyro.blogspot.com\/2013\/07\/jsp<\/a><\/li>\r\n \t<li><a href=\"https:\/\/docs.oracle.com\/cd\/E17802_01\/pro\">https:\/\/docs.oracle.com\/cd\/E17802_01\/pro<\/a><\/li>\r\n \t<li><a href=\"https:\/\/www.scribd.com\/document\/24372464\">https:\/\/www.scribd.com\/document\/24372464<\/a><\/li>\r\n \t<li><a href=\"https:\/\/www.coursehero.com\/file\/p5hm8co\/\">https:\/\/www.coursehero.com\/file\/p5hm8co\/<\/a><\/li>\r\n \t<li><a href=\"https:\/\/docs.oracle.com\/javaee\/6\/tutoria\">https:\/\/docs.oracle.com\/javaee\/6\/tutorial<\/a><\/li>\r\n \t<li><a href=\"http:\/\/www.jdjua.com\/javaj2ee.htm\">http:\/\/www.jdjua.com\/javaj2ee.htm<\/a><\/li>\r\n \t<li><a href=\"https:\/\/www.javatpoint.com\/jsp-tutorial\">https:\/\/www.javatpoint.com\/jsp-tutorial<\/a><\/li>\r\n \t<li><a href=\"https:\/\/www.tutorialspoint.com\/jsp\/\">https:\/\/www.tutorialspoint.com\/jsp\/<\/a><\/li>\r\n \t<li><a href=\"http:\/\/www.wideskills.com\/jsp\/jsp-session-tracking-techniques\">http:\/\/www.wideskills.com\/jsp\/jsp-session-tracking-techniques<\/a><\/li>\r\n \t<li><a href=\"http:\/\/www.cnblogs.com\/jams742003\/archiv\">http:\/\/www.cnblogs.com\/jams742003\/archiv<\/a><\/li>\r\n \t<li><a href=\"http:\/\/www.slideshare.net\/java2all\/jsp-e\">http:\/\/www.slideshare.net\/java2all\/jsp-e<\/a><\/li>\r\n \t<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/javapapers.com\/jsp\/explain-the-js\">http:\/\/javapapers.com\/jsp\/explain-the-js<\/a><\/li>\r\n \t<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.docjar.com\/html\/api\/javax\/ser\">http:\/\/www.docjar.com\/html\/api\/javax\/ser<\/a><\/li>\r\n \t<li><a style=\"text-align: initial;font-size: 1em\" href=\"https:\/\/javakeypoint.wordpress.com\/2016\/\">https:\/\/javakeypoint.wordpress.com\/2016\/<\/a><\/li>\r\n \t<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.journaldev.com\/2038\/jsp-impli\">http:\/\/www.journaldev.com\/2038\/jsp-implicit<\/a><\/li>\r\n \t<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.perisastry.com\/java\/IncludeDi\">http:\/\/www.perisastry.com\/java\/IncludeDi<\/a><\/li>\r\n \t<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.javatpoint.com\/jsp-include-ac\">http:\/\/www.javatpoint.com\/jsp-include-ac<\/a><\/li>\r\n \t<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/docs.oracle.com\/cd\/B14099_19\/web\">http:\/\/docs.oracle.com\/cd\/B14099_19\/web<\/a><\/li>\r\n \t<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.codejava.net\/java-ee\/jsp\/jsp-\">http:\/\/www.codejava.net\/java-ee\/jsp\/jsp-<\/a><\/li>\r\n \t<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.xyzws.com\/jspfaq\/what-are-jsp\">http:\/\/www.xyzws.com\/jspfaq\/what-are-jsp<\/a><\/li>\r\n \t<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.albeesonline.com\/code\/\">http:\/\/www.albeesonline.com\/code\/<\/a><\/li>\r\n \t<li><span style=\"text-align: initial;font-size: 1em\">Philip Hanna, \u201c JSP : The Complete Reference\u201d, Second Edition, McGrawHill Publishers Ltd<\/span><\/li>\r\n \t<li><span style=\"text-align: initial;font-size: 1em\">Daniel Liang.Y , \u201cIntroduction to Java Programming\u201d, Ninth Edition, Prentice Hall.<\/span><\/li>\r\n<\/ul>\r\n<\/div>","rendered":"<div>\n<p><strong>1. JSPElements \u2013 JSP Actions<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Let us explore the JSP Action elements first. Actions are high-level JSP elements which are used to create, modify or use other JSP objects. Unlike directives and scripting elements, JSP actions are coded using strict XML syntax form. By using of JSP action elements we can dynamically insert a file, reuse JavaBeans components, forward the user to another page, or generate HTML for the Java plugins etc.Usage of syntax for the Action element, is given below as it conforms to the XML standard:<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;jsp:action_name attribute=&#8221;value&#8221; \/&gt;<\/p>\n<p>Action elements are basically predefined functions and the following JSP actions are available for use:<\/p>\n<p>&lt;jsp:param&gt;,\u00a0\u00a0 &lt;jsp:include&gt;,\u00a0\u00a0\u00a0 &lt;jsp:forward&gt;,\u00a0\u00a0\u00a0 &lt;jsp:fallback&gt;,\u00a0\u00a0\u00a0 &lt;jsp:plugin&gt;,\u00a0\u00a0\u00a0 &lt;jsp:useBean&gt;,<\/p>\n<p>&lt;jsp:setProperty&gt;,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;jsp:getProperty&gt;<\/p>\n<p>Let us explore the element tags one by one,<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1.1 JSP Elements: JSP Actions (param)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The &lt;jsp:param&gt; action is basically used to provide information in the form of name value pairs to the current request. This action can also be used in alongwith jsp:include, jsp:forward andjsp:pluginactions. The syntax of jsp:param is<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;jsp:param name=\u201dparameter_name\u201d value=\u201dparameter_value\u201d \/&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>Example for jsp:param tag is:<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;jsp: include page \u201cprocess.jsp\u201d&gt; &lt;jsp:param name = \u201cuser\u201d value = \u201cmona\u201d\/&gt; &lt;jsp:param name = \u201csessionid\u201d value = \u201c1234D3F\u201d\/&gt;<\/p>\n<p>&lt;\/jsp:include&gt;<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p><strong>1.2 JSP Elements: JSP Actions (include)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The jsp:include action tag is used to include the content of other resources such as a jsp, html or servlet file in a JSP page. The jsp:include tag can also be used to include static as well as dynamic pages. The jsp include action tag tries to include the resources at the request time and it is a good opinion for dynamic pages. The advantage of jsp: include is code reusability where we can make of use a page number of times.For example we can use jsp include action tag for including header and footer pages in all the pages. This may save a lots of time.<\/p>\n<p>&nbsp;<\/p>\n<p>Syntax of jsp:include action tag without parameter is:<\/p>\n<p>&lt;jsp:include page=&#8221;relativeURL | &lt;%= expression %&gt;&#8221; \/&gt;<\/p>\n<p>Syntax of jsp:include action tag with parameter is:<\/p>\n<p>&lt;jsp:include page=&#8221;relativeURL | &lt;%= expression %&gt;&#8221;&gt;<\/p>\n<p>&lt;jsp:param name=&#8221;parametername&#8221; value=&#8221;parametervalue | &lt;%=expression%&gt;&#8221; \/&gt; &lt;\/jsp:include&gt;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">An example of jsp:include action tag without parameter is given below.In this example, index.jsp file includes the content of the printdate.jsp file.<\/p>\n<p>&nbsp;<\/p>\n<p>File: index.jsp<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;h2&gt;this is index page&lt;\/h2&gt;<\/p>\n<p>&lt;jsp:include page=&#8221;printdate.jsp&#8221; \/&gt;<\/p>\n<p>&lt;h2&gt;end section of index page&lt;\/h2&gt; File: printdate.jsp<\/p>\n<p>&lt;% out.print (&#8220;Today is:&#8221;+java.util.Calendar.getInstance ().getTime ()); %&gt;<\/p>\n<p>Now the difference betweenjsp:include and include directive used in JSPshould be known. This is explained in Table 1.<\/p>\n<p>&nbsp;<\/p>\n<p>Table 1. Comparison between jsp:include and include directive<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-327 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-202.png\" alt=\"\" width=\"618\" height=\"208\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-202.png 618w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-202-300x101.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-202-65x22.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-202-225x76.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-202-350x118.png 350w\" sizes=\"auto, (max-width: 618px) 100vw, 618px\" \/><\/p>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-328 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-203.png\" alt=\"\" width=\"622\" height=\"177\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-203.png 622w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-203-300x85.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-203-65x18.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-203-225x64.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-203-350x100.png 350w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/p>\n<p>&nbsp;<\/p>\n<div>\n<p><strong>1.3 JSP Elements: JSP Actions (forward)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">While we use forward action tag , the current page stops processing the request and forwards the request to another page. After execution forwarding to the new page, execution never returns to the calling or current page.<\/p>\n<p>&nbsp;<\/p>\n<p>Syntax of JSP Action(forward) tag is :<\/p>\n<p>&lt;jsp:forward page= \u201cfile_name\u201d \/&gt;<\/p>\n<p>Or it can be also be written as:<\/p>\n<p>&lt;jsp: forward page= \u201cfile_name\u201d&gt;<\/p>\n<p>&lt;jsp:param name=\u201dparameter_name\u201d value=\u201dparameter_value\u201d \/&gt;&lt;\/jsp: forward&gt;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">An example of jsp:forward action tag without parameter is discussed here.In the following example, an attempt has been made to simply forward the request to the print date .jsp file.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>index.jsp<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;h2&gt;this is index page&lt;\/h2&gt;<\/p>\n<p>&lt;jsp:forward page=&#8221;printdate.jsp&#8221; \/&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1.4JSP Elements: JSP Actions (useBean)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Usage of beantag through JSP actions instantiates a Java bean object into the JSP page. (UseBeanProperty has been used in two flavors: getProperty and setProperty. jsp:useBean creates a new instance of a bean and its syntax is<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;jsp:useBean id=\u201cobject_Name&#8221; class=\u201cclass name\u201c &gt;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">Where id is the name of the object, class is aJavabean class from which the object gets instantiated.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">This is equivalent to the JSP systax:<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;% class_name object_name = new class_name(); %&gt;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">Example to instantiate a Factorial bean in a JSP page is given below:<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;jsp:useBean id = \u201cfact\u201d class = \u201cbean.Factorial\u201d\/&gt;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">This is equivalent to the JSP scriplet<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;% bean.Factorial fact = new bean.Factorial(); %&gt;<\/span><\/p>\n<\/div>\n<div>\n<p><strong>\u00a0 \u00a0 <\/strong><\/p>\n<p><strong>1.4.1 JSP Actions (jsp:setProperty)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>jsp:getProperty reads and outputs the value of a bean property (ie.,calling a getter method) and its syntax is<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;jsp:getProperty name=&#8221;beanName&#8221; property=&#8221;propertyName&#8221; \/&gt;<\/p>\n<p>An example for gtPropertyis &lt;jsp:getProperty name = \u201cfact\u201d property = \u201cvalue\u201d\/&gt;<\/p>\n<p>This is equivalent to JSP Scriplet:<\/p>\n<p>&lt;%= fact.getValue() %&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1.4.2 JSP Actions (jsp:setProperty)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>jsp:setProperty modifies a bean property (by calling a setter method)<\/p>\n<p>&nbsp;<\/p>\n<p>&lt;jsp:setProperty<\/p>\n<p>name=&#8221;beanName&#8221;<\/p>\n<p>property=&#8221;propertyName\u201c<\/p>\n<p>value=&#8221;propertyValue&#8221; \/&gt;<\/p>\n<p>An example for Set Property is:<\/p>\n<p>&lt;jsp: setProperty name=\u201cfact\u201d property = \u201cvalue\u201d value =\u201c5\u201d \/&gt;<\/p>\n<p>This is equivalent to the JSP Scriplet:<\/p>\n<p>&lt;%fact.setValue(5)%&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2.JSP Implicit Objects<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">JSP implicit objects are created by the container automatically. When a web server processes a JSP page( during the translation of a JSP page to a Servlet source to help developers). These\u00a0<span style=\"text-align: initial;font-size: 1em\">objects can also be used directly in scriptlets that goes in service method. Nine Implicit Objects can be used in a JSP page as discussed below:<\/span><\/p>\n<\/div>\n<div>\n<p>\u00a0 \u00a0 a) Request object: Request implicit object is to get the data on a JSP page which has been entered by the user in frontend<\/p>\n<p>String Uid= request.getParameter(&#8220;user-id&#8221;);<\/p>\n<p>String Pass= request.getParameter(&#8220;password&#8221;);<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">b) Response Object: This is the HttpServletResponse object associated with the response to the client this is used to send responses to the client.<\/p>\n<p>&nbsp;<\/p>\n<p>response.setContentType(&#8220;text\/html&#8221;);<\/p>\n<p>response.setContentType(&#8220;image\/gif&#8221;);<\/p>\n<p>response.setContentType(&#8220;image\/png&#8221;);<\/p>\n<p>response.setContentType(&#8220;application\/pdf&#8221;);<\/p>\n<p>&nbsp;<\/p>\n<p>c) Session:This is the most frequently used implicit object, which is used for storing the user\u2019s data to make\u00a0\u00a0\u00a0 it available on other JSP pages till the user\u00a0\u00a0\u00a0\u00a0 session is active.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">d) Out: This is used for writing content to the client(browser). This has several methods which can be used for properly formatting output message to the browser and for dealing with the buffer.<\/p>\n<p>&nbsp;<\/p>\n<p>Example:<\/p>\n<p>&nbsp;<\/p>\n<p>out.println(\u201chi\u201d); out.println(\u201chello\u201d);<\/p>\n<p>&nbsp;<\/p>\n<p>e) Application:This is used for getting application-wide initialization parameters and to maintain useful data across whole JSP application.<\/p>\n<p>&nbsp;<\/p>\n<p>Example:<\/p>\n<p>&nbsp;<\/p>\n<p>String s = (String)application.getAttribute(&#8220;MyAttr&#8221;);<\/p>\n<p>&nbsp;<\/p>\n<p>This example would return the object stored in the attribute \u201cMyAttr\u201d.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">f) Exception:This object is used in exception handling for displaying error messages. This object is only available to the JSP pages, whereisErrorPage attribute is set to true.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">g) Page : JSP page implicit object is an instance of java.lang.Object class, which indicates the current JSP page. The Page object provide reference to the generated servlet class.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">h) PageContext Object : This implicit object is an instance of javax.servlet.jsp.PageContextabstract classimplementation. PageContext to get and set attributes with different scopes and to forward request to other resources. PageContext objectccan be used also holds references to other implicit objects.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">i) Config Object : This is used to get the JSP initparamsconfigured in the deployment descriptor.<\/span><\/p>\n<\/div>\n<div>\n<p><strong>\u00a0 \u00a0 \u00a0<\/strong><\/p>\n<p><strong>2.1 JSP Implicit objects \u2013 Class files (instantiation)<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>The JSP Class files which are involved in Implicit objects are defined below:<\/p>\n<p>&nbsp;<\/p>\n<p>\u2022\u00a0 application: javax.servlet.ServletContext<\/p>\n<p>\u2022\u00a0 config: javax.servlet.ServletConfig<\/p>\n<p>\u2022\u00a0 exception: java.lang.Throwable<\/p>\n<p>\u2022\u00a0 out: javax.servlet.jsp.JspWriter<\/p>\n<p>\u2022\u00a0 page: java.lang.Object<\/p>\n<p>\u2022\u00a0 pageContext: javax.servlet.jsp.PageContext<\/p>\n<p>\u2022\u00a0 request: javax.servlet.ServletRequest<\/p>\n<p>\u2022\u00a0 response: javax.servlet.ServletResponse<\/p>\n<p>\u2022\u00a0 session: javax.servlet.http.HttpSession<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2.2 Example for the JSP Implicit objects<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">To demonstrate the usage of JSP Implicit objects, an example which makes use of Request, Response, Out and session objects has been given below,<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Index.html<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;title&gt;Login Page&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;form action=&#8221;checkdetails.jsp&#8221;&gt;<\/p>\n<p>UserId:&lt;input type=&#8221;text&#8221; name=&#8221;id&#8221; \/&gt;&lt;br&gt;&lt;br&gt; Password: &lt;input type=&#8221;text&#8221; name=&#8221;pass&#8221; \/&gt;&lt;br&gt;&lt;br&gt;<\/p>\n<p>&lt;input type=&#8221;submit&#8221; value=&#8221;Sign In!!&#8221;\/&gt; &lt;\/form&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>Sign in Form: Receiving id and password from User Login page<\/p>\n<p>&nbsp;<\/p>\n<p><strong>checkdetails.jsp<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;title&gt;Check Credentials&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;&lt;body&gt;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;% String uid=<\/span><strong style=\"text-align: initial;font-size: 1em\">request<\/strong><span style=\"text-align: initial;font-size: 1em\">.getParameter(&#8220;id&#8221;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">String password=<\/span><strong style=\"text-align: initial;font-size: 1em\">request<\/strong><span style=\"text-align: initial;font-size: 1em\">.getParameter(&#8220;pass&#8221;);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">session.setAttribute(&#8220;session-uid&#8221;, uid);<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">if(uid.equals(&#8220;Chaitanya&#8221;) &amp;&amp;password.equals(&#8220;BeginnersBook&#8221;))<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">{ <\/span><strong style=\"text-align: initial;font-size: 1em\">response<\/strong><span style=\"text-align: initial;font-size: 1em\">.sendRedirect(&#8220;success.jsp&#8221;); }<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">else { <\/span><strong style=\"text-align: initial;font-size: 1em\">response<\/strong><span style=\"text-align: initial;font-size: 1em\">.sendRedirect(&#8220;failed.jsp&#8221;); } %&gt; &lt;\/body&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/html&gt;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">This JSP page verifies the input id\/pass against hard-coded values.<\/span><\/p>\n<\/div>\n<div>\n<p><strong>\u00a0 \u00a0success.jsp<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;title&gt;Success Page&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;% String data=(String)session.getAttribute (&#8220;session-uid&#8221;); out.println(&#8220;Welcome &#8220;+ data+&#8221;!!&#8221;); %&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>This JSP page would execute if id\/pass are matched to the hardcoded userid\/password.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>failed.jsp<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;title&gt;Sign-in Failed Page&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;&lt;body&gt;<\/p>\n<p>&lt;% String data2=(String)session.getAttribute (&#8220;session-uid&#8221;);<\/p>\n<p>out.println(&#8220;Hi &#8220;+ data2+&#8221;. Id\/Password are wrong. Please try Again.&#8221;); %&gt; &lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&nbsp;<\/p>\n<p>The control will be redirected to this page if the credentials entered by user are wrong.<\/p>\n<p>Output of JSP page thatreceives id and password andcorrectlyverified is shown in Figure 1.<\/p>\n<\/div>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-329 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-204.png\" alt=\"\" width=\"510\" height=\"328\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-204.png 510w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-204-300x193.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-204-65x42.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-204-225x145.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-204-350x225.png 350w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">Figure 1Output of JSP page that receive id and password andcorrect verification.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">If Sign-In has been failed ,when Id and Password provided is are wrong the output is displayed shown in Figure2.<\/span><\/p>\n<div>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-330 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-205.png\" alt=\"\" width=\"549\" height=\"354\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-205.png 549w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-205-300x193.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-205-65x42.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-205-225x145.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-205-350x226.png 350w\" sizes=\"auto, (max-width: 549px) 100vw, 549px\" \/><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<div>\n<p><strong>\u00a0 \u00a0 3.JSP &#8211; Exception Handling<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The exception is normally an object that is thrown during the runtime. Exception Handling is the processused to handle the runtime errors. There may be a possibility that exception may occur at any time in our web application. So handling exceptions is a safer side for the web developers.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In JSP, there are two ways to perform exception handling, one is by using errorPage and isErrorPage attributes of page directive and the other one is by using&lt;error-page&gt; element in web.xml file.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>3.1 Example of JSPexception handling using the elements of page directive<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">To demonstrate the usage of JSP Exception Handling, three jsp pages have been designed in this example. Out of which, one page has been defined\/created to handle the exceptions(in this example names error.jsp). Another page is defined with errorPage attribute of page directive.(as defined by the process.jsp page) and one more page is used for getting values.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Define and create a page to handle the exceptions, named error.jsp page, where the possibility of exception may arise, For example : 3 files are designed<\/p>\n<ul>\n<li>index.jsp for getting input values<\/li>\n<li>process.jsp for dividing the two numbers and displaying the result<\/li>\n<li>error.jsp for handling the exception<\/li>\n<\/ul>\n<p><strong>\u00a0 \u00a0 \u00a0 index.jsp<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;form action=&#8221;process.jsp&#8221;&gt;<\/p>\n<p>No1:&lt;input type=&#8221;text&#8221; name=&#8221;n1&#8243; \/&gt;&lt;br\/&gt;&lt;br\/&gt; No1:&lt;input type=&#8221;text&#8221; name=&#8221;n2&#8243; \/&gt;&lt;br\/&gt;&lt;br\/&gt; &lt;input type=&#8221;submit&#8221; value=&#8221;divide&#8221;\/&gt; &lt;\/form&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>process.jsp<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;%@ page errorPage=&#8221;error.jsp&#8221; %&gt;<\/p>\n<p>&lt;%<\/p>\n<p>String num1=request.getParameter(&#8220;n1&#8221;);<\/p>\n<p>String num2=request.getParameter(&#8220;n2&#8221;);<\/p>\n<p>int a=Integer.parseInt(num1);<\/p>\n<p>int b=Integer.parseInt(num2);<\/p>\n<p>int c=a\/b;<\/p>\n<p>out.print(&#8220;division of numbers is: &#8220;+c);<\/p>\n<p>%&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>error.jsp<\/strong><\/p>\n<\/div>\n<div>\n<p>\u00a0 \u00a0&lt;%@ page isErrorPage=&#8221;true&#8221; %&gt;<\/p>\n<p>&lt;h3&gt;Sorry an exception occured!&lt;\/h3&gt;<\/p>\n<p>Exception is: &lt;%= exception %&gt;<\/p>\n<p>Output of this example is given in Figure 3 and Figure 4.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-331 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-206.png\" alt=\"\" width=\"526\" height=\"514\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-206.png 526w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-206-300x293.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-206-65x64.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-206-225x220.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-206-350x342.png 350w\" sizes=\"auto, (max-width: 526px) 100vw, 526px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>5.\u00a0\u00a0<\/strong><strong>JSP Session Tracking<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In a web application, server may be responding to several clients at a time. Hence, so session tracking is a way by which a server can identify the client uniquely.As we know HTTP\u00a0<span style=\"text-align: initial;font-size: 1em\">protocol is stateless which means client needs to open a separate connection every time it interacts with server and server treats each request as a new request. In order to identify the client, server needs to maintain the state and to do so, there are several session tracking techniques. They are listed below:<\/span><\/p>\n<\/div>\n<div>\n<p><strong>\u00a0 \u00a0<\/strong><\/p>\n<p><strong> 5.1 Session Tracking Techniques<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Session Tracking has following fields:<\/p>\n<p>&nbsp;<\/p>\n<p>\u2022 Hidden fields<\/p>\n<p>\u2022 URL rewriting<\/p>\n<p>\u2022 Cookies<\/p>\n<p>\u2022 Session Objects<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">With Cookies, Hidden Fields and URL rewriting approaches, client always sends a unique identifier with each request and server determines the user session based on that unique identifier whereas in the session tracking approach using Session Object it uses all the other three techniques internally.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>5.2 Session tracking using Cookies:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Out of the four session tracking techniques, session tracking using cookie has been discussed here, If cookie is associated with the client request, server will associate it with corresponding user session otherwise it will create a new unique cookie and send it back with response. Cookie objects are can be created using a name value pair.For example we can create a cookie with the name sessionId and with a unique value for each client. Later this can be added it in a response so that it will be sent back to the client.<\/p>\n<p>&nbsp;<\/p>\n<p>Syntax of creating Cookie in a JSP is:<\/p>\n<p>&nbsp;<\/p>\n<p>Cookie cookie = new Cookie(\u201csessionID\u201d, \u201csome unique value\u201d); response.addCookie(cookie);<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The following examples illustrate the usage of cookie1.jsp is used to accept the username. Cookie2.jsp creates and sets a cookie with maximum age, whereas cookie3.jsp file is used to display the values of the cookies.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>cookie1.jsp:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;form method = &#8220;post&#8221; action=&#8221;cookie2.jsp&#8221;&gt; &lt;font&gt;Username&lt;input type = &#8220;text&#8221; name = &#8220;name&#8221;&gt;&lt;\/font&gt; &lt;\/font&gt;&lt;br&gt;<\/p>\n<p>&lt;input type = &#8220;submit&#8221; name = &#8220;submit&#8221; value = &#8220;submit&#8221; &gt;<\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/form&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/body&gt;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">&lt;\/html&gt;<\/span><\/p>\n<\/div>\n<div>\n<p><strong>\u00a0 \u00a0<\/strong><\/p>\n<p><strong> cookie2.jsp:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>&lt;%@ page language=&#8221;java&#8221; import=&#8221;java.util.*&#8221;%&gt; &lt;% String name=request.getParameter(&#8220;name&#8221;); Cookie cookie = new Cookie (&#8220;name&#8221;,name); response.addCookie(cookie); cookie.setMaxAge(50 * 50); \/\/Time is in Minutes%&gt;<\/p>\n<p>&lt;a href=&#8221;cookie3.jsp&#8221;&gt;Continue&lt;\/a&gt;<\/p>\n<p>cookie3.jsp:<\/p>\n<p>&lt;p&gt;Display the value of the Cookie&lt;\/p&gt;<\/p>\n<p>&lt;%<\/p>\n<p>Cookie[] cookies = request.getCookies();<\/p>\n<p>for (inti=0; i&lt;cookies.length; i++)<\/p>\n<p>{<\/p>\n<p>if(cookies[i].getName().equals(&#8220;name&#8221;))<\/p>\n<p>out.println(&#8220;Hello&#8221;+cookies[i].getValue());<\/p>\n<p>}<\/p>\n<p>%&gt;<\/p>\n<p style=\"text-align: justify\">With respect to the above code, output of Cookie1.jsp, Cookie2.jsp and Cookie3.jsp has been shown in the figures 5, 6, 7 respectively.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-332 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-207.png\" alt=\"\" width=\"457\" height=\"180\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-207.png 457w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-207-300x118.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-207-65x26.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-207-225x89.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-207-350x138.png 350w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 4. Output of Cookie1.jsp<\/strong><\/p>\n<\/div>\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-333 aligncenter\" src=\"http:\/\/csp12.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-208.png\" alt=\"\" width=\"498\" height=\"462\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-208.png 498w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-208-300x278.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-208-65x60.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-208-225x209.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-content\/uploads\/sites\/60\/2018\/07\/Untitled-208-350x325.png 350w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/p>\n<div>\n<p><strong>\u00a0 \u00a0Summary<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">This Chapter illustrated the usage of JSP action tags with its various types and formats.This Chapter has also demonstrated the usage of various implicit objects with suitable examples. Later the usage of cookies in session tracking has also been dealt.<\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>Web Links<\/strong><\/p>\n<ul>\n<li>http:\/\/www.fas.harvard.edu\/~cscie259\/lectures\/<\/li>\n<li><a href=\"http:\/\/docs.oracle.com\/cd\/E21764_01\/web\">http:\/\/docs.oracle.com\/cd\/E21764_01\/web<\/a><\/li>\n<li><a href=\"http:\/\/www.cse.buffalo.edu\/faculty\/bina\/gridforce\/586.htm\">http:\/\/www.cse.buffalo.edu\/faculty\/bina\/gridforce\/586.htm<\/a> <a href=\"http:\/\/docs.oracle.com\/cd\/E21764_01\/web\">http:\/\/docs.oracle.com\/cd\/E21764_01\/web<\/a><\/li>\n<li><a href=\"http:\/\/javatyro.blogspot.com\/2013\/07\/jsp\">http:\/\/javatyro.blogspot.com\/2013\/07\/jsp<\/a><\/li>\n<li><a href=\"https:\/\/docs.oracle.com\/cd\/E17802_01\/pro\">https:\/\/docs.oracle.com\/cd\/E17802_01\/pro<\/a><\/li>\n<li><a href=\"https:\/\/www.scribd.com\/document\/24372464\">https:\/\/www.scribd.com\/document\/24372464<\/a><\/li>\n<li><a href=\"https:\/\/www.coursehero.com\/file\/p5hm8co\/\">https:\/\/www.coursehero.com\/file\/p5hm8co\/<\/a><\/li>\n<li><a href=\"https:\/\/docs.oracle.com\/javaee\/6\/tutoria\">https:\/\/docs.oracle.com\/javaee\/6\/tutorial<\/a><\/li>\n<li><a href=\"http:\/\/www.jdjua.com\/javaj2ee.htm\">http:\/\/www.jdjua.com\/javaj2ee.htm<\/a><\/li>\n<li><a href=\"https:\/\/www.javatpoint.com\/jsp-tutorial\">https:\/\/www.javatpoint.com\/jsp-tutorial<\/a><\/li>\n<li><a href=\"https:\/\/www.tutorialspoint.com\/jsp\/\">https:\/\/www.tutorialspoint.com\/jsp\/<\/a><\/li>\n<li><a href=\"http:\/\/www.wideskills.com\/jsp\/jsp-session-tracking-techniques\">http:\/\/www.wideskills.com\/jsp\/jsp-session-tracking-techniques<\/a><\/li>\n<li><a href=\"http:\/\/www.cnblogs.com\/jams742003\/archiv\">http:\/\/www.cnblogs.com\/jams742003\/archiv<\/a><\/li>\n<li><a href=\"http:\/\/www.slideshare.net\/java2all\/jsp-e\">http:\/\/www.slideshare.net\/java2all\/jsp-e<\/a><\/li>\n<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/javapapers.com\/jsp\/explain-the-js\">http:\/\/javapapers.com\/jsp\/explain-the-js<\/a><\/li>\n<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.docjar.com\/html\/api\/javax\/ser\">http:\/\/www.docjar.com\/html\/api\/javax\/ser<\/a><\/li>\n<li><a style=\"text-align: initial;font-size: 1em\" href=\"https:\/\/javakeypoint.wordpress.com\/2016\/\">https:\/\/javakeypoint.wordpress.com\/2016\/<\/a><\/li>\n<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.journaldev.com\/2038\/jsp-impli\">http:\/\/www.journaldev.com\/2038\/jsp-implicit<\/a><\/li>\n<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.perisastry.com\/java\/IncludeDi\">http:\/\/www.perisastry.com\/java\/IncludeDi<\/a><\/li>\n<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.javatpoint.com\/jsp-include-ac\">http:\/\/www.javatpoint.com\/jsp-include-ac<\/a><\/li>\n<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/docs.oracle.com\/cd\/B14099_19\/web\">http:\/\/docs.oracle.com\/cd\/B14099_19\/web<\/a><\/li>\n<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.codejava.net\/java-ee\/jsp\/jsp-\">http:\/\/www.codejava.net\/java-ee\/jsp\/jsp-<\/a><\/li>\n<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.xyzws.com\/jspfaq\/what-are-jsp\">http:\/\/www.xyzws.com\/jspfaq\/what-are-jsp<\/a><\/li>\n<li><a style=\"text-align: initial;font-size: 1em\" href=\"http:\/\/www.albeesonline.com\/code\/\">http:\/\/www.albeesonline.com\/code\/<\/a><\/li>\n<li><span style=\"text-align: initial;font-size: 1em\">Philip Hanna, \u201c JSP : The Complete Reference\u201d, Second Edition, McGrawHill Publishers Ltd<\/span><\/li>\n<li><span style=\"text-align: initial;font-size: 1em\">Daniel Liang.Y , \u201cIntroduction to Java Programming\u201d, Ninth Edition, Prentice Hall.<\/span><\/li>\n<\/ul>\n<\/div>\n","protected":false},"author":4,"menu_order":32,"template":"","meta":{"_acf_changed":false,"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":["dr-s-abirami"],"pb_section_license":""},"chapter-type":[],"contributor":[59],"license":[],"class_list":["post-326","chapter","type-chapter","status-publish","hentry","contributor-dr-s-abirami"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapters\/326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/wp\/v2\/users\/4"}],"version-history":[{"count":5,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapters\/326\/revisions"}],"predecessor-version":[{"id":615,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapters\/326\/revisions\/615"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapters\/326\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/wp\/v2\/media?parent=326"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/pressbooks\/v2\/chapter-type?post=326"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/wp\/v2\/contributor?post=326"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp12\/wp-json\/wp\/v2\/license?post=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}