|
|
Java Server Page, JSP
|
Explain why and how to disable session in a JSP page.
Answer
Disabling the session improves the performance of a JSP container. When a JSP
is requested, an HttpSession object is created to maintain a state that is
unique for each client. The session data is accessible as an implicit session
object and sessions are enabled by default.
Session object uses the server resources which causes an increase in the
traffic as the session ID is sent from server to client and then vice versa. If
a few JSP pages get a large number of hits, there is no need to identify the
user. Hence, in this case it is better to have a session in a JSP page
disabled.
The session in the JSP file can be disabled by setting the session attribute to
false in the following manner:
<%@ page session="false" %>
More JSP Links
Answer - These are the objects that are available for the use
in JSP documents. You don’t need........
Answer - A forward is server side redirect while sendRedirect
is client side redirect.....
Answer - Servlet's life cycle comprises of the following
steps:.....
Answer - There are three forms of JSP scripting elements
that let you insert Java code.......
|
|
|
|
|