Two Laptop Bag*
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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp And Servlets Clash" Watch "Jsp And Servlets Clash" New topic
Author

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 (ChatServer.java) , null value is being returned and corresponding exception is thrown. But if the same thing is implemented in servlets itself (login.java), 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
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp And Servlets Clash
 
Similar Threads
Urgent -RequestDispatcher.include and forward
How to navigate from jsp-to servlets-and again to another -jsp
Optimizing Session tracking code.
Can a jsp talk to a servlet?
Servlet Error Page