This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessions in non-servlets

 
Shrikanth Goloposwami
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a HttpServlet controller that intercepts requests and maps those requests to Action objects. These Action objects are not HttpServlets; however, there is a need to retrieve the request sent by the HttpServlet controller, create a session and pass the request back to the controller for forwarding. The sessions are being created successfully in the Action objects, it just can't pass the session along to the HttpServlet controller. Is is possible to pass HttpSession objects from a non-servlet to a servlet via the request object?
Any thoughts?
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have the javax.servlet.http.HttpServletRequest request as argument of your action methods.(or in the constructor)
Then when you call the action method, you still have a request object you can work with and you can send back to a servlet later.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic