can we get HttpServletRequest object in listeners? if so how? if not why?
Thanks inadvance.
manokaran.d durairaj
Greenhorn
Joined: Oct 03, 2007
Posts: 1
posted
0
HttpServletRequest not in Listeners. Because Listeners only look for event.like attribute added removed and also .don't want the client request or response.
and from ServletRequestEvent.getServletRequest() which returns the ServletRequest.
I am just a brick in the wall of Java
Abdul Rahman
Ranch Hand
Joined: Jul 04, 2008
Posts: 62
posted
0
Hi Vijaya,
can we get HttpServletRequest object in listeners?
if so how?
if not why?
There are 8 listeners and 6 events associated with these listeners. out of these 6 events only ServletRequestEvent Class has got a method getServletRequest().
so if you are writing a class that implements ServletRequestListener interface, then you get ServletRequestEvent. From this event you can call getServletRequest(). you will have to cast it to HttpServletRequest.
You will not get request objects in other listeners because the API does not provide for it.