You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Joaquin Diez (JIRA)" <ji...@apache.org> on 2008/02/15 13:26:40 UTC

[jira] Created: (WW-2492) New Cookie added does not work when redirect-action used.

New Cookie added does not work when redirect-action used.
---------------------------------------------------------

                 Key: WW-2492
                 URL: https://issues.apache.org/struts/browse/WW-2492
             Project: Struts 2
          Issue Type: Bug
          Components: Core Actions, Core Interceptors
    Affects Versions: 2.0.11
         Environment: Tomcat 5.5 JDK 1.5 
            Reporter: Joaquin Diez


I am developing an Authentication Interceptor, that when the user is logged, creates an Cookie that saves same information...so after the action.invoke()  I create the new Cookie and add it to the HttpServletResponse object.


Cookie userCookie = unienceCookieBuilder.uniencePrincipal2cookie(uniencePrincipalAfter);
response.addCookie(userCookie);

the result of the Action is configured to make and redirect-action


               <action name="Login" method="execute" class="loginAction">
			<result name="input" type="tiles">unience.login</result>
			<result name="success" type="redirect-action">
				<param name="actionName">desktop</param>
				<param name="namespace">/desktop</param>
				<param name="request_locale">${locale_req}</param>
			</result>
		</action>


The problem is that the Cookie added  disappears, so never gets into the brower, and I can retrive those data I need..

  


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


[jira] Work started: (WW-2492) New Cookie added does not work when redirect-action used.

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

Work on WW-2492 started by Joaquin Diez.

> New Cookie added does not work when redirect-action used.
> ---------------------------------------------------------
>
>                 Key: WW-2492
>                 URL: https://issues.apache.org/struts/browse/WW-2492
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions, Core Interceptors
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5 JDK 1.5 
>            Reporter: Joaquin Diez
>            Assignee: Joaquin Diez
>
> I am developing an Authentication Interceptor, that when the user is logged, creates an Cookie that saves same information...so after the action.invoke()  I create the new Cookie and add it to the HttpServletResponse object.
> Cookie userCookie = unienceCookieBuilder.uniencePrincipal2cookie(uniencePrincipalAfter);
> response.addCookie(userCookie);
> the result of the Action is configured to make and redirect-action
>                <action name="Login" method="execute" class="loginAction">
> 			<result name="input" type="tiles">unience.login</result>
> 			<result name="success" type="redirect-action">
> 				<param name="actionName">desktop</param>
> 				<param name="namespace">/desktop</param>
> 				<param name="request_locale">${locale_req}</param>
> 			</result>
> 		</action>
> The problem is that the Cookie added  disappears, so never gets into the brower, and I can retrive those data I need..
>   

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


[jira] Commented: (WW-2492) New Cookie added does not work when redirect-action used.

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43225#action_43225 ] 

Dave Newton commented on WW-2492:
---------------------------------

http://struts.apache.org/2.x/docs/writing-interceptors.html

{info}
Keep in mind that invoke will return after the result has been called (eg. after you JSP has been rendered), making it perfect for things like open-session-in-view patterns. If you want to do something before the result gets called, you should implement a PreResultListener.
{info}

My interpretation of that is that it's too late to do anything with the response after {{invoke}} has been called.

Please follow up if this solves your problem so I can close this issue; I don't believe it's a bug (yet :)

> New Cookie added does not work when redirect-action used.
> ---------------------------------------------------------
>
>                 Key: WW-2492
>                 URL: https://issues.apache.org/struts/browse/WW-2492
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions, Core Interceptors
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5 JDK 1.5 
>            Reporter: Joaquin Diez
>
> I am developing an Authentication Interceptor, that when the user is logged, creates an Cookie that saves same information...so after the action.invoke()  I create the new Cookie and add it to the HttpServletResponse object.
> Cookie userCookie = unienceCookieBuilder.uniencePrincipal2cookie(uniencePrincipalAfter);
> response.addCookie(userCookie);
> the result of the Action is configured to make and redirect-action
>                <action name="Login" method="execute" class="loginAction">
> 			<result name="input" type="tiles">unience.login</result>
> 			<result name="success" type="redirect-action">
> 				<param name="actionName">desktop</param>
> 				<param name="namespace">/desktop</param>
> 				<param name="request_locale">${locale_req}</param>
> 			</result>
> 		</action>
> The problem is that the Cookie added  disappears, so never gets into the brower, and I can retrive those data I need..
>   

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


[jira] Commented: (WW-2492) New Cookie added does not work when redirect-action used.

Posted by "Joaquin Diez (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43266#action_43266 ] 

Joaquin Diez commented on WW-2492:
----------------------------------

you are absolutely rigth.. implementing PreResulListener is solved...

> New Cookie added does not work when redirect-action used.
> ---------------------------------------------------------
>
>                 Key: WW-2492
>                 URL: https://issues.apache.org/struts/browse/WW-2492
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions, Core Interceptors
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5 JDK 1.5 
>            Reporter: Joaquin Diez
>
> I am developing an Authentication Interceptor, that when the user is logged, creates an Cookie that saves same information...so after the action.invoke()  I create the new Cookie and add it to the HttpServletResponse object.
> Cookie userCookie = unienceCookieBuilder.uniencePrincipal2cookie(uniencePrincipalAfter);
> response.addCookie(userCookie);
> the result of the Action is configured to make and redirect-action
>                <action name="Login" method="execute" class="loginAction">
> 			<result name="input" type="tiles">unience.login</result>
> 			<result name="success" type="redirect-action">
> 				<param name="actionName">desktop</param>
> 				<param name="namespace">/desktop</param>
> 				<param name="request_locale">${locale_req}</param>
> 			</result>
> 		</action>
> The problem is that the Cookie added  disappears, so never gets into the brower, and I can retrive those data I need..
>   

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


[jira] Assigned: (WW-2492) New Cookie added does not work when redirect-action used.

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

Joaquin Diez reassigned WW-2492:
--------------------------------

    Assignee: Joaquin Diez

> New Cookie added does not work when redirect-action used.
> ---------------------------------------------------------
>
>                 Key: WW-2492
>                 URL: https://issues.apache.org/struts/browse/WW-2492
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions, Core Interceptors
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5 JDK 1.5 
>            Reporter: Joaquin Diez
>            Assignee: Joaquin Diez
>
> I am developing an Authentication Interceptor, that when the user is logged, creates an Cookie that saves same information...so after the action.invoke()  I create the new Cookie and add it to the HttpServletResponse object.
> Cookie userCookie = unienceCookieBuilder.uniencePrincipal2cookie(uniencePrincipalAfter);
> response.addCookie(userCookie);
> the result of the Action is configured to make and redirect-action
>                <action name="Login" method="execute" class="loginAction">
> 			<result name="input" type="tiles">unience.login</result>
> 			<result name="success" type="redirect-action">
> 				<param name="actionName">desktop</param>
> 				<param name="namespace">/desktop</param>
> 				<param name="request_locale">${locale_req}</param>
> 			</result>
> 		</action>
> The problem is that the Cookie added  disappears, so never gets into the brower, and I can retrive those data I need..
>   

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


[jira] Closed: (WW-2492) New Cookie added does not work when redirect-action used.

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

Dave Newton closed WW-2492.
---------------------------

    Resolution: Not A Problem
      Assignee:     (was: Joaquin Diez)

Glad to hear it!

Closing this issue as per reporter comment.

> New Cookie added does not work when redirect-action used.
> ---------------------------------------------------------
>
>                 Key: WW-2492
>                 URL: https://issues.apache.org/struts/browse/WW-2492
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions, Core Interceptors
>    Affects Versions: 2.0.11
>         Environment: Tomcat 5.5 JDK 1.5 
>            Reporter: Joaquin Diez
>
> I am developing an Authentication Interceptor, that when the user is logged, creates an Cookie that saves same information...so after the action.invoke()  I create the new Cookie and add it to the HttpServletResponse object.
> Cookie userCookie = unienceCookieBuilder.uniencePrincipal2cookie(uniencePrincipalAfter);
> response.addCookie(userCookie);
> the result of the Action is configured to make and redirect-action
>                <action name="Login" method="execute" class="loginAction">
> 			<result name="input" type="tiles">unience.login</result>
> 			<result name="success" type="redirect-action">
> 				<param name="actionName">desktop</param>
> 				<param name="namespace">/desktop</param>
> 				<param name="request_locale">${locale_req}</param>
> 			</result>
> 		</action>
> The problem is that the Cookie added  disappears, so never gets into the brower, and I can retrive those data I need..
>   

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