• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 458
  • Last Modified:

HttpSession creation

Hi

When is an httpSession object created.  For instance if a request is made to a jsp page ie index.jsp, will the httpsession object be created in the first request or will it be created the next time a request is made to the server?

thanks in advance
0
inzaghi
Asked:
inzaghi
  • 2
1 Solution
 
bloodredsunCommented:
As I understand it's made at the first request in a JSP unless you have set the session attribute of page to be false. Otherwise every request would be the first one and you would never know about the second! :-)

e.g.
<%@page session="false" %>
0
 
bloodredsunCommented:
You can show this by this jsp as your index.jsp:

<html>
<body>
<% session.setAttribute("name" , "sessioniscreated!!!!!!") ;%>
<%= session.getAttribute("name")%>"
</body>
</html>
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now