Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HttpSession and HttpServlet singletons?

glassfoxJan 3 2011 — edited Jan 4 2011
Hi guys,

I have here two questions for better understanding of the HttpSession and HttpServlet classes:

1. Is the HttpSession object existing between the server and the client and used for data exchange a kind of singleton? E.g. if I call a servlet concurrently with different parameters (as shown above), will this conflict on evaluation of the session parameters on the servlet side?
"...MyPage.jsp?attr1=1..."
"...MyPage.jsp?attr1=2..."

2. Is the Servlet itself ( "public class MyServlet extends HttpServlet{..." ) also a singleton? I.e. for the above described use case also a problem?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 1 2011
Added on Jan 3 2011
11 comments
1,973 views