aspose 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
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to use HttpServletRequest to get an Application scope variable ?