Accesing Cookies from a custom interceptor
Hi there, I am writing a custom authentication and authorization interceptor and need access to cookies. I've checked in Struts2 and other docs both ways of getting access to cookies. I can't use CookieInterceptor or CookiesAware interface as I need cookies in the interceptor, not in an action, so the only way I've found is using the static method at org.apache.struts2.ServletActionContext.getRequest() to get the request and getting cookies from it. I'd like to know if there is another path to get cookies in my interceptor. I've been developing on struts for a couple of years but I'm pretty newbie to struts2. Thanks for any help/directions, Ignacio -- View this message in context: http://www.nabble.com/Accesing-Cookies-from-a-custom-interceptor-tp21565072p21565072.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Accesing Cookies from a custom interceptor
I have used the static method you describe in the past. Ignacio de Córdoba wrote: Hi there, I am writing a custom authentication and authorization interceptor and need access to cookies. I've checked in Struts2 and other docs both ways of getting access to cookies. I can't use CookieInterceptor or CookiesAware interface as I need cookies in the interceptor, not in an action, so the only way I've found is using the static method at org.apache.struts2.ServletActionContext.getRequest() to get the request and getting cookies from it. I'd like to know if there is another path to get cookies in my interceptor. I've been developing on struts for a couple of years but I'm pretty newbie to struts2. Thanks for any help/directions, Ignacio -- View this message in context: http://www.nabble.com/Accesing-Cookies-from-a-custom-interceptor-tp21565072p21566829.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Accesing Cookies from a custom interceptor
2009/1/20 Ignacio de Córdoba icord...@skios.es: I'd like to know if there is another path to get cookies in my interceptor. I've been developing on struts for a couple of years but I'm pretty newbie to struts2. I think you should follow CookieInterceptor [1] approach which is using: HttpServletRequest request = ServletActionContext.getRequest(); [1] http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/CookieInterceptor.java?view=markup Regards -- Lukasz http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org