| Author |
how tto initialize HttpServletRequest
|
nimo frey
Ranch Hand
Joined: Jun 28, 2008
Posts: 580
|
|
How can I obtain the reference of an HttpServletRequest within the sessionCreated-Method of HttpSessionListener? something like: This does not work: Any Ideas? [ September 08, 2008: Message edited by: nimo frey ]
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
You can't directly initialize an HttpServletRequest. Why are you trying to? What is it you are trying to do?
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
nimo frey
Ranch Hand
Joined: Jun 28, 2008
Posts: 580
|
|
I want to get the methods available of HttpServletRequest. I want to do something like: Should I implement a method in my listener: then I can call the global String ip in my sessionCreated-Method: But this does not work..string is allways null. any ideas?
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
A session listener is designed to listen to session events. If you want to handle requests a Servlet is the tool you would normally use. If you want functionality accross all requests, a filter is a better choice.
|
 |
nimo frey
Ranch Hand
Joined: Jun 28, 2008
Posts: 580
|
|
As I use JSF and want avoid implementing Servlets directyl, I will try to use filters.. thanks.
|
 |
 |
|
|
subject: how tto initialize HttpServletRequest
|
|
|