File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Jsp And Servlets Clash Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp And Servlets Clash" Watch "Jsp And Servlets Clash" New topic

Jsp And Servlets Clash

ch praveen
Ranch Hand

Joined: Mar 08, 2004
Posts: 67
Hello Friends,
For my multiclient chatserver program, I have created a login page in jsp (login.jsp) that stores the users details(as a hashtable) in a SevletContext by the name USERS_TABLE. If I tried to access that users list in a servlet ( , null value is being returned and corresponding exception is thrown. But if the same thing is implemented in servlets itself (, things are working fine. Can't we set ServletContext's attributes and Session Attritibute's in a JSP page and could retrieve in a SERVLET and viceversa. Eventhough jsp is a wrapper for a servlet, why this is not working. I greatly appreciate your valuable suggestions in advance.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

Please see this topic for a message concerning your display name.
If the servlet and JSP are in the same context they will both access the same servlet context.

[Asking smart questions] [About Bear] [Books by Bear]
subject: Jsp And Servlets Clash
It's not a secret anymore!