wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to use HttpServletRequest to get an Application scope variable ?
 
Similar Threads
JSTL listing all keys of a property file
Passing Parameters with navigation rules
How can I access JSF managed bean from JSF converter?
how to use getLastModified( HttpServletRequest ) in JSP ?
Get different scope attribute by using EL