You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Dean Pullen (JIRA)" <ji...@apache.org> on 2009/02/09 19:54:46 UTC

[jira] Created: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Validation messages do not get displayed using a redirectAction as the input
----------------------------------------------------------------------------

                 Key: WW-2987
                 URL: https://issues.apache.org/struts/browse/WW-2987
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - Portlet
    Affects Versions: 2.1.6
         Environment: JBoss Portal 2.7.1
            Reporter: Dean Pullen


This was originally posted to the mailing list without being solved.

It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
<s:actionerror />
<s:fielderror />

We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.


For example this is the view, which is the input of the edit action:
                               <action name="ItemView" class="com.msp.portlets.ItemAction">
                                                <interceptor-ref name="portletDefaultStack"/>                                                                                              
                                                <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
                                </action>            

This is the edit action:
                               <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
                                                <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
                                                <result type="redirectAction" name="success">
                                                                <param name="actionName">ItemView</param>                                                                
                                                </result>
                                                <result type="redirectAction" name="input"> 
                                                                <param name="actionName"> ItemView </param>
                                                 </result>
                                </action>

This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.

Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.

Utilising the messageStoreInterceptor does not help.


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


[jira] Reopened: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

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

Nils-Helge Garli reopened WW-2987:
----------------------------------


Messages should be preserved from action to render phase. If it doesn't, it's a bug. 

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: item.jsp, ItemAction.java, struts-test.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Commented: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45569#action_45569 ] 

Musachy Barroso commented on WW-2987:
-------------------------------------

Feel free to re-open if you determine that the portlet plugin is not working as it should.

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Updated: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

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

Dean Pullen updated WW-2987:
----------------------------

    Attachment: ItemAction.java

Test class

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: item.jsp, ItemAction.java, struts-test.xml, struts.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Updated: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

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

Dean Pullen updated WW-2987:
----------------------------

    Attachment: struts.xml

Struts config file with test namespace

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: struts-test.xml, struts.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Commented: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Nils-Helge Garli (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45782#action_45782 ] 

Nils-Helge Garli commented on WW-2987:
--------------------------------------

I'm guessing that the "input" quirk has something to do with validation, in which case I'm not sure if this is a bug at all.

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: item.jsp, ItemAction.java, struts-test.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Commented: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45564#action_45564 ] 

Musachy Barroso commented on WW-2987:
-------------------------------------

fieldErrors, actionErrors and actionMessages are lost on redirects. Using the session(messageStoreInterceptor uses the session) is the way to go, if you need to do a redirect. There isn't much that struts can do in this case.

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Updated: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

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

Dean Pullen updated WW-2987:
----------------------------

    Attachment: item.jsp

JSP test file

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: item.jsp, ItemAction.java, struts-test.xml, struts.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Issue Comment Edited: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Dean Pullen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45571#action_45571 ] 

deanpullen edited comment on WW-2987 at 2/10/09 4:29 AM:
----------------------------------------------------------

Ok, as requested via the mailing lists, I'm reopening this issue.  

As a summary - a JSP forward as the input will work (provided you're using the portalDefaultStack throughout the process)

A redirectAction will not work, with or without using messageStoreInterceptor.

You can get a redirectAction to work if you 'fudge' the process, using a messageStoreInterceptor, by including an input result on the action used by redirectAction - which is slightly odd.

I'm attaching a test class, a test struts-test.xml, and an appropriate JSP.
If you wished this to be packed in someway different, let me know.

      was (Author: deanpullen):
    Ok, as requested via the mailing lists, I'm reopening this issue.  

As a summary - a JSP forward as the input will work (provided you're using the portalDefaultStack throughout the process)

A redirectAction will not work, with or without using messageStoreInterceptor.

You can get a redirectAction to work if you 'fudge' the process, using a messageStoreInterceptor, by including an input result on the action used by redirectAction - which is slightly odd.

I'm attaching a test class, a test struts-test.xml (uses namespace 'test' to get the JSP forward to work), and an appropriate JSP.
If you wished this to be packed in someway different, let me know.
  
> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: item.jsp, ItemAction.java, struts-test.xml, struts.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Commented: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Dean Pullen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45563#action_45563 ] 

Dean Pullen commented on WW-2987:
---------------------------------

Any properties that have been filled in the form, are also lost on a redirect, which will undoubtedly be a problem for our users.

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Updated: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

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

Musachy Barroso updated WW-2987:
--------------------------------

    Attachment:     (was: struts.xml)

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: item.jsp, ItemAction.java, struts-test.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Commented: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Dean Pullen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45571#action_45571 ] 

Dean Pullen commented on WW-2987:
---------------------------------

Ok, as requested via the mailing lists, I'm reopening this issue.  

As a summary - a JSP forward as the input will work, but ONLY if you use a non-root namespace for the relevent actions.

A redirectAction will not work, with or without using messageStoreInterceptor.

You can get a redirectAction to work if you 'fudge' the process, using a messageStoreInterceptor, by including an input result on the action used by redirectAction - which is slightly odd.

I'm attaching a test class, a test struts-test.xml (uses namespace 'test' to get the JSP forward to work), and an appropriate JSP.
If you wished this to be packed in someway different, let me know.

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Commented: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Nils-Helge Garli (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45781#action_45781 ] 

Nils-Helge Garli commented on WW-2987:
--------------------------------------

After looking at the code again, and tracing some history, I have to correct myself. If you're using a redirectAction, you should use the message store interceptor, just as you should be doing in a regular web app. It's only when you're not using the redirectAction the messages are automatically copied to the next request. 

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: item.jsp, ItemAction.java, struts-test.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Commented: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Dean Pullen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45576#action_45576 ] 

Dean Pullen commented on WW-2987:
---------------------------------

Struts.xml can be ingored - please remove too!

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: item.jsp, ItemAction.java, struts-test.xml, struts.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Resolved: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

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

Musachy Barroso resolved WW-2987.
---------------------------------

    Resolution: Not A Problem

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Updated: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

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

Dean Pullen updated WW-2987:
----------------------------

    Attachment: struts-test.xml

Struts config file with test namespace

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: struts-test.xml, struts.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Commented: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45567#action_45567 ] 

Musachy Barroso commented on WW-2987:
-------------------------------------

I regular apps (non-portlet), the messageStoreInterceptor  just grabs the info and puts it in the session, which works, I think the problem you are having is that in a portlet environment the session works differently, I can really say for sure as I have never used portlets. I will comment on the email thread and close this ticket for now.

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Commented: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Dean Pullen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46221#action_46221 ] 

Dean Pullen commented on WW-2987:
---------------------------------

This is still an open issue. Though you can retrieve the action messages using the message store interceptor, it will merely forward the input phase straight to the input redirectAction's JSP, not through it's assigned method.
This means you can not repopulate a form that has had properties lost due to the redirect.

E.g.

Within the example XML file we have this redirectAction input:

<result type="redirectAction" name="input">
<param name="actionName">ItemViewForStore</param>
</result>

This means the input should go to the 'ItemViewForStore' action. It does. But it uses ItemViewForStore's mapping of 'input' which is a JSP, and although it will execute the prepare method of the ItemViewForStore action it will not execute the execute method.


> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: item.jsp, ItemAction.java, struts-test.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Issue Comment Edited: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Musachy Barroso (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45567#action_45567 ] 

musachy edited comment on WW-2987 at 2/9/09 11:20 AM:
--------------------------------------------------------------

In regular apps (non-portlet), the messageStoreInterceptor  just grabs the info and puts it in the session, which works, I think the problem you are having is that in a portlet environment the session works differently, I can't really say for sure as I have never used portlets. I will comment on the email thread and close this ticket for now.

      was (Author: musachy):
    I regular apps (non-portlet), the messageStoreInterceptor  just grabs the info and puts it in the session, which works, I think the problem you are having is that in a portlet environment the session works differently, I can really say for sure as I have never used portlets. I will comment on the email thread and close this ticket for now.
  
> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Commented: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Dean Pullen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45565#action_45565 ] 

Dean Pullen commented on WW-2987:
---------------------------------

Apologies if this isn't a bug then - we had presumed messageStoreInterceptor  would rectify this, as we've used this for non-portlet projects, however, as I said at the bottom, this doesn't (appear to) work either.

> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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


[jira] Issue Comment Edited: (WW-2987) Validation messages do not get displayed using a redirectAction as the input

Posted by "Dean Pullen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45571#action_45571 ] 

deanpullen edited comment on WW-2987 at 2/10/09 4:29 AM:
----------------------------------------------------------

Ok, as requested via the mailing lists, I'm reopening this issue.  

As a summary - a JSP forward as the input will work (provided you're using the portalDefaultStack throughout the process)

A redirectAction will not work, with or without using messageStoreInterceptor.

You can get a redirectAction to work if you 'fudge' the process, using a messageStoreInterceptor, by including an input result on the action used by redirectAction - which is slightly odd.

I'm attaching a test class, a test struts-test.xml (uses namespace 'test' to get the JSP forward to work), and an appropriate JSP.
If you wished this to be packed in someway different, let me know.

      was (Author: deanpullen):
    Ok, as requested via the mailing lists, I'm reopening this issue.  

As a summary - a JSP forward as the input will work, but ONLY if you use a non-root namespace for the relevent actions.

A redirectAction will not work, with or without using messageStoreInterceptor.

You can get a redirectAction to work if you 'fudge' the process, using a messageStoreInterceptor, by including an input result on the action used by redirectAction - which is slightly odd.

I'm attaching a test class, a test struts-test.xml (uses namespace 'test' to get the JSP forward to work), and an appropriate JSP.
If you wished this to be packed in someway different, let me know.
  
> Validation messages do not get displayed using a redirectAction as the input
> ----------------------------------------------------------------------------
>
>                 Key: WW-2987
>                 URL: https://issues.apache.org/struts/browse/WW-2987
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.1.6
>         Environment: JBoss Portal 2.7.1
>            Reporter: Dean Pullen
>         Attachments: item.jsp, ItemAction.java, struts-test.xml, struts.xml
>
>
> This was originally posted to the mailing list without being solved.
> It seems we're correctly directed back to the input when Validation isn't passed, but we cannot pick up the error messages using the usual tags:
> <s:actionerror />
> <s:fielderror />
> We're utilising the portletDefaultStack and our Portlet package is extending struts-portlet-default. Our package has no name-space set.
> For example this is the view, which is the input of the edit action:
>                                <action name="ItemView" class="com.msp.portlets.ItemAction">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                              
>                                                 <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                                 </action>            
> This is the edit action:
>                                <action name="ItemEdit" class="com.msp.portlets. ItemAction" method="itemEdit">
>                                                 <interceptor-ref name="portletDefaultStack"/>                                                                                                                     
>                                                 <result type="redirectAction" name="success">
>                                                                 <param name="actionName">ItemView</param>                                                                
>                                                 </result>
>                                                 <result type="redirectAction" name="input"> 
>                                                                 <param name="actionName"> ItemView </param>
>                                                  </result>
>                                 </action>
> This works perfectly if the redirectAction input is replaced with a standard JSP forward, and the validation errors are shown to the user.
> Utilising validation XML instead of annotations produces the same problem - redirectAction does not work, JSP does.
> Utilising the messageStoreInterceptor does not help.

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