org.apache.struts2.interceptor
Class CookieProviderInterceptor
java.lang.Object
com.opensymphony.xwork2.interceptor.AbstractInterceptor
org.apache.struts2.interceptor.CookieProviderInterceptor
- All Implemented Interfaces:
- Interceptor, PreResultListener, Serializable
public class CookieProviderInterceptor
- extends AbstractInterceptor
- implements PreResultListener
Allows actions to send cookies to client, action must implement CookieProvider
You must reference this interceptor in your default stack or in action's stack, see example below.
none
- addCookiesToResponse - this method applies cookie created by action to response
<action ... >
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="cookieProvider"/>
...
</action>
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CookieProviderInterceptor
public CookieProviderInterceptor()
intercept
public String intercept(ActionInvocation invocation)
throws Exception
- Specified by:
intercept
in interface Interceptor
- Specified by:
intercept
in class AbstractInterceptor
- Throws:
Exception
addCookiesToResponse
protected void addCookiesToResponse(CookieProvider action,
javax.servlet.http.HttpServletResponse response)
- Do what name suggests
- Parameters:
action
- CookieProvider
actionresponse
- current HttpServletResponse
beforeResult
public void beforeResult(ActionInvocation invocation,
String resultCode)
- Specified by:
beforeResult
in interface PreResultListener
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.