File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes how to use HttpServletRequest to get an Application scope variable ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to use HttpServletRequest to get an Application scope variable ?" Watch "how to use HttpServletRequest to get an Application scope variable ?" New topic
Author

how to use HttpServletRequest to get an Application scope variable ?

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
how to use HttpServletRequest to get an Application scope variable ?

Thanks.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"You can't get there from he-ya"
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html

But you can get to the session from your request.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSession.html

From the session, you can get a reference to the ServletContext.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html

Which will, of course give you access to the context attributes.



Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to use HttpServletRequest to get an Application scope variable ?