File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 60782
    
  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
Servlet Error Page
Urgent -RequestDispatcher.include and forward
Optimizing Session tracking code.
Can a jsp talk to a servlet?
How to navigate from jsp-to servlets-and again to another -jsp