That interface is for actions, not interceptors.
On May 23, 2013 5:30 PM, "john lee" <[email protected]> wrote:
> Please advise the following
>
> for struts2, for an login action, an predefined interceptor is triggered
> for checking cookie , the code is the following
>
> for SecurityVerifySessionIntercepter, i implement the
> ServletRequestAware, but get null catached.
>
> my question is:
>
> for intercepter, Request object can not be implemented? if can, why i get
> null?
>
> thanks in advance
>
> john
>
>
>
> public class SecurityVerifySessionIntercepter extends AbstractInterceptor
> implements ServletResponseAware, ServletRequestAware {
>
>
> protected HttpServletResponse servletResponse;
> public void setServletResponse(HttpServletResponse servletResponse)
> { this.servletResponse = servletResponse; }
>
> protected HttpServletRequest servletRequest;
> public void setServletRequest(HttpServletRequest servletRequest) {
> this.servletRequest = servletRequest; }
>
> public String intercept(ActionInvocation invocation) throws Exception {
>
> ActionContext ctx=invocation.getInvocationContext();
> Map session= ctx.getContext().getSession();
>
> if (servletRequest==null)
> System.out.println(" Request object is null catched");
> Cookie cookieList[]=servletRequest.getCookies();
>