struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <davelnew...@gmail.com>
Subject Re: Cookie in struts2
Date Wed, 15 May 2013 21:14:17 GMT
Import the Cookie class, and get the cookies from the request, not the
class of the request?

Dave



On Wed, May 15, 2013 at 4:56 PM, john lee <sh_thorn_bird@yahoo.com> wrote:

>
>
> I have no difficulty to handle cookie in struts 1, but have lots of error
> in struts 2
>
> i have the following program
>
>
> public class SecurityVerifySessionIntercepter extends AbstractInterceptor
> implements ServletResponseAware, ServletRequestAware {
> ....
>
> Map session= ActionContext.getContext().getSession();
>
>
> Cookie cookieList[]=HttpServletRequest.getCookies();
>
> for above program, the compiler give so much error about cookie.
>
>
> cannot find symbol
> symbol  : class Cookie
> location: class SecurityVerifySessionIntercepter
>           Cookie cookieList[]=HttpServletRequest.getCookies();
>
>
> non-static method getCookies() cannot be referenced from a static context
>           Cookie cookieList[]=HttpServletRequest.getCookies();
>
>
>
> please advise
>
> thanks in advance
>
> john




-- 
e: davelnewton@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton <https://twitter.com/dave_newton>
b: Bucky Bits <http://buckybits.blogspot.com/>
g: davelnewton <https://github.com/davelnewton>
so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message