Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use HttpServletRequest to get an Application scope variable ?

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to use HttpServletRequest to get an Application scope variable ?

Thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic