1) What Is JSP?: Method Description
1) What Is JSP?: Method Description
A JSP page is internally converted into the servlet. JSP has access to the entire family of
the Java API including JDBC API to access enterprise database. Hence, Java language
syntax has been used in the java server pages (JSP). The JSP pages are more accessible
to maintain than Servlet because we can separate designing and development. It
provides some additional features such as Expression Language, Custom Tags, etc.
More details.
Method Description
Object Type
1) out JspWriter
2) request HttpServletRequest
3) response HttpServletResponse
4) config ServletConfig
5) session HttpSession
6) application ServletContext
7) pageContext PageContext
8) page Object
9) exception Throwable
More details.
7) What is the difference between include directive
and include action?
1) The include directive includes the 1) The include action includes the content at
content at page translation time. request time.
2) The include directive includes the 2) The include action doesn't include the
original content of the page, so page original content rather invokes the include()
size increases at runtime method of Vendor provided class.
3) It's better for static pages. 3) 3) It's better for dynamic pages.
1. <%
2. response.setHeader("Cache-Control","no-store");
3. response.setHeader("Pragma","no-cache");
4. response.setHeader ("Expires", "0"); //prevents caching at the proxy server
5. %>
More details.
o By include directive
o By include action
More details.
More details.
1. page
2. request
3. session
4. application
More details.
o page
o request
o session
o application
More details.
1. core tags
2. sql tags
3. xml tags
4. internationalization tags
5. functions tags
More details.
1. jsp:useBean
2. jsp:setProperty
3. jsp:getProperty
More details.
o jsp:forward: This action tag forwards the request and response to another
resource.
o jsp:include: This action tag is used to include another resource.
o jsp:useBean: This action tag is used to create and locates bean object.
o jsp:setProperty: This action tag is used to set the value of the property of the
bean.
o jsp:getProperty: This action tag is used to print the value of the property of the
bean.
o jsp:plugin: This action tag is used to embed another component such as the
applet.
o jsp:param: This action tag is used to set the parameter value. It is used in
forward and includes mostly.
o jsp:fallback: This action tag can be used to print the message if the plugin is
working.
1. <html>
2. <head>
3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4. <title>Mouse Drag</title>
5. </head>
6. <body bgcolor="khaki">
7. <h1>Mouse Drag Example</h1>
8.
9. <jsp:plugin align="middle" height="500" width="500"
10. type="applet" code="MouseDrag.class" name="clock" codebase="."/>
11.
12. </body>
13. </html>
There are many implicit objects, operators and reserve words in EL.
pageScope it maps the given attribute name with the value set in the page scope
requestScope it maps the given attribute name with the value set in the request
scope
sessionScope it maps the given attribute name with the value set in the session
scope
applicationScope it maps the given attribute name with the value set in the application
scope