You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "James Cook (JIRA)" <ji...@apache.org> on 2010/09/09 01:09:33 UTC

[jira] Created: (WW-3497) Unable to use CookieInterceptor

Unable to use CookieInterceptor
-------------------------------

                 Key: WW-3497
                 URL: https://issues.apache.org/jira/browse/WW-3497
             Project: Struts 2
          Issue Type: Bug
          Components: Core Interceptors
    Affects Versions: 2.2.1
         Environment: Win 7, Java 6
            Reporter: James Cook


When using the CookieInterceptor with the CookiesAware interface the map injected is always empty, unless you specify the cookieName parameter. 

Then however interceptor wants to inject that cookie value onto a member of the action class, this then becomes unusable in the case of a cookie name having a dynamic component. E.g. Facebooks Auth cookie and thus doesn't have a direct member mapping in the class

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-3497) Unable to use CookieInterceptor

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maurizio Cucchiara updated WW-3497:
-----------------------------------

    Attachment: WW-3497.patch

I know what you mean. IMHO, the best behavior it's similar to the session one.
The attached patch contains an other point of view about cookie interceptor.
It allows you to manipulate (setting, removing, editing) cookie collection inside your action class.
Furthermore, it allows you to refer to cookies through ognl notation (ex <s:property value="#cookie.nameCookie"/> or <s:property value="#cookie['nameCookie']"/> )
To use it,  you should instance interceptor in this way:
<interceptors>
            <interceptor name="cookieBean" class="org.apache.struts2.interceptor.CookieBeanInterceptor"/>
            <interceptor-stack name="cookie-default">
                <interceptor-ref name="defaultStack"/>
                <interceptor-ref name="cookieBean"/>
            </interceptor-stack>
</interceptors>

> Unable to use CookieInterceptor
> -------------------------------
>
>                 Key: WW-3497
>                 URL: https://issues.apache.org/jira/browse/WW-3497
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.2.1
>         Environment: Win 7, Java 6
>            Reporter: James Cook
>         Attachments: WW-3497.patch
>
>
> When using the CookieInterceptor with the CookiesAware interface the map injected is always empty, unless you specify the cookieName parameter. 
> Then however interceptor wants to inject that cookie value onto a member of the action class, this then becomes unusable in the case of a cookie name having a dynamic component. E.g. Facebooks Auth cookie and thus doesn't have a direct member mapping in the class

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (WW-3497) Unable to use CookieInterceptor

Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart reassigned WW-3497:
---------------------------------

    Assignee: Lukasz Lenart

> Unable to use CookieInterceptor
> -------------------------------
>
>                 Key: WW-3497
>                 URL: https://issues.apache.org/jira/browse/WW-3497
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.2.1
>         Environment: Win 7, Java 6
>            Reporter: James Cook
>            Assignee: Lukasz Lenart
>         Attachments: WW-3497.patch
>
>
> When using the CookieInterceptor with the CookiesAware interface the map injected is always empty, unless you specify the cookieName parameter. 
> Then however interceptor wants to inject that cookie value onto a member of the action class, this then becomes unusable in the case of a cookie name having a dynamic component. E.g. Facebooks Auth cookie and thus doesn't have a direct member mapping in the class

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.