You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dean Pullen <de...@msp-uk.com> on 2009/02/09 18:33:36 UTC

Struts 2 Portlet Validation Problems

Hi all,

 

We've been trying to get validation (using annotations) working within a
Struts Portlet for a couple of days - without success, when the input is
a redirectAction.

When the input result is a JSP, it works fine. We're using the
messageStoreInterceptor.

 

We're using JBoss Portal 2.7.1 and Struts 2.1.6.

 

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"/>


                                                <interceptor-ref
name="messageStoreInterceptor">

                                                                <param
name="operationMode">RETRIEVE</param>

                                                </interceptor-ref>

 
<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"/>

                                                <interceptor-ref
name="messageStoreInterceptor">

                                                                <param
name="operationMode">STORE</param>

                                                </interceptor-ref>


                                                <result
type="redirectAction" name="success">

                                                                <param
name="actionName">ItemView</param>

                                                                <param
name="itemId">${itemId}</param>

                                                </result>

                                                <result
type="redirectAction" name="input"> 

                                                                <param
name="actionName"> ItemView </param>

</result>

                                </action>

 

Does anyone know what the problem could be?

 

Thanks in advance.


Re: Struts 2 Portlet Validation Problems

Posted by Musachy Barroso <mu...@gmail.com>.
Here is the ticket Nils:

https://issues.apache.org/struts/browse/WW-2987

musachy

On Tue, Feb 10, 2009 at 12:24 AM, Torsten Krah
<tk...@fachschaft.imn.htwk-leipzig.de> wrote:
> Am Montag, 9. Februar 2009 21:48:33 schrieb Nils-Helge Garli Hegvik:
>> This should be handled by the default portlet interceptor stack. If it
>> doesn't, it's a bug...
>
> Its a bug i guess, i need to use a Message Store Interceptor too, because
> using PRG in portlets i lost my messages and errors always (can't remember
> that this worked once  and i didn't know that this should have had to work
> ;-)).
>
> Torsten
>
> --
> Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
> Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html
>
> Really, I'm not out to destroy Microsoft. That will just be a
> completely unintentional side effect."
>        -- Linus Torvalds
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Portlet Validation Problems

Posted by Greg Lindholm <gl...@yahoo.com>.
If you are finding Message Store Interceptor a pain to use you might want to
look at my RedirectMessageInterceptor it's a lot easier to use.  (Be sure to
check out the comments as there is a suggested enhancement to support
PortletActionRedirectResult.) 

http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/
http://glindholm.wordpress.com/2008/07/02/preserving-messages-across-a-redirect-in-struts-2/ 


Torsten Krah wrote:
> 
> Am Montag, 9. Februar 2009 21:48:33 schrieb Nils-Helge Garli Hegvik:
>> This should be handled by the default portlet interceptor stack. If it
>> doesn't, it's a bug...
> 
> Its a bug i guess, i need to use a Message Store Interceptor too, because 
> using PRG in portlets i lost my messages and errors always (can't remember 
> that this worked once  and i didn't know that this should have had to work 
> ;-)).
> 
> Torsten
> 
> -- 
> Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
> Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html
> 
> Really, I'm not out to destroy Microsoft. That will just be a 
> completely unintentional side effect."
> 	-- Linus Torvalds
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/Struts-2-Portlet-Validation-Problems-tp21917888p21939287.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Portlet Validation Problems

Posted by Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>.
Am Montag, 9. Februar 2009 21:48:33 schrieb Nils-Helge Garli Hegvik:
> This should be handled by the default portlet interceptor stack. If it
> doesn't, it's a bug...

Its a bug i guess, i need to use a Message Store Interceptor too, because 
using PRG in portlets i lost my messages and errors always (can't remember 
that this worked once  and i didn't know that this should have had to work 
;-)).

Torsten

-- 
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html

Really, I'm not out to destroy Microsoft. That will just be a 
completely unintentional side effect."
	-- Linus Torvalds

Re: Struts 2 Portlet Validation Problems

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
This should be handled by the default portlet interceptor stack. If it
doesn't, it's a bug...

Nils-H

On Mon, Feb 9, 2009 at 8:19 PM, Musachy Barroso <mu...@gmail.com> wrote:
> Messages will be lost if a redirectAction is used, unless the
> MessageStoreInterceptor is used, or is that different in portlets
> Nils?
>
> musachy
>
> On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen <de...@msp-uk.com> wrote:
>> I can confirm that using validation xml instead of annotations does
>> exactly the same thing.
>>
>> i.e. a forward to a JSP will display the messages, a redirectAction type
>> result will 'lose' the messages during the dispatch.
>>
>> Dean.
>>
>> -----Original Message-----
>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>> Sent: 09 February 2009 18:07
>> To: Struts Users Mailing List
>> Subject: Re: Struts 2 Portlet Validation Problems
>>
>> Yeah, you're right... It's not using annotations. Have you tried with
>> xml validation? It's not a solution, but at least it will narrow down
>> the problem.
>>
>> Nils-H
>>
>> On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen <de...@msp-uk.com>
>> wrote:
>>> Nils-H,
>>>
>>> Thanks for the reply.
>>>
>>> I've looked at them - none of them actually use the annotations as
>> such.
>>>
>>> It's definitely not working with or without MessageStoreInterceptor
>> when
>>> you utilise a redirect - it's absolutely fine if you simply replace
>> the
>>> redirect with a simple JSP result.
>>>
>>> Dean.
>>>
>>> -----Original Message-----
>>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>>> Sent: 09 February 2009 17:57
>>> To: Struts Users Mailing List
>>> Subject: Re: Struts 2 Portlet Validation Problems
>>>
>>> Have you tried installing the portlet sample app? I believe there are
>>> a couple of validation scenarios there. As far as I know, it should
>>> work. You shouldn't even need the MessageStoreInterceptor, since the
>>> portlet default stack should handle preserving messages across
>>> redirects.
>>>
>>> Nils-H
>>>
>>> On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com>
>>> wrote:
>>>> Hi all,
>>>>
>>>>
>>>>
>>>> We've been trying to get validation (using annotations) working
>> within
>>> a
>>>> Struts Portlet for a couple of days - without success, when the input
>>> is
>>>> a redirectAction.
>>>>
>>>> When the input result is a JSP, it works fine. We're using the
>>>> messageStoreInterceptor.
>>>>
>>>>
>>>>
>>>> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>>>>
>>>>
>>>>
>>>> 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"/>
>>>>
>>>>
>>>>                                                <interceptor-ref
>>>> name="messageStoreInterceptor">
>>>>
>>>>                                                                <param
>>>> name="operationMode">RETRIEVE</param>
>>>>
>>>>                                                </interceptor-ref>
>>>>
>>>>
>>>> <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"/>
>>>>
>>>>                                                <interceptor-ref
>>>> name="messageStoreInterceptor">
>>>>
>>>>                                                                <param
>>>> name="operationMode">STORE</param>
>>>>
>>>>                                                </interceptor-ref>
>>>>
>>>>
>>>>                                                <result
>>>> type="redirectAction" name="success">
>>>>
>>>>                                                                <param
>>>> name="actionName">ItemView</param>
>>>>
>>>>                                                                <param
>>>> name="itemId">${itemId}</param>
>>>>
>>>>                                                </result>
>>>>
>>>>                                                <result
>>>> type="redirectAction" name="input">
>>>>
>>>>                                                                <param
>>>> name="actionName"> ItemView </param>
>>>>
>>>> </result>
>>>>
>>>>                                </action>
>>>>
>>>>
>>>>
>>>> Does anyone know what the problem could be?
>>>>
>>>>
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>> Scanned by MailDefender - managed email security from intY -
>>> www.maildefender.net
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 2 Portlet Validation Problems

Posted by Dean Pullen <de...@msp-uk.com>.
No problem, will do - in the morning!

Thanks.

-----Original Message-----
From: Musachy Barroso [mailto:musachy@gmail.com] 
Sent: 09 February 2009 20:51
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet Validation Problems

You can reopen the one I closed, and add any extra info you found.

musachy

On Mon, Feb 9, 2009 at 3:49 PM, Nils-Helge Garli Hegvik
<ni...@gmail.com> wrote:
> That should not be necessary. Could you please register a JIRA issue,
> and if possible, a simple app that can reproduce the issue?
>
> Thanks.
>
> Nils-H
>
> On Mon, Feb 9, 2009 at 9:09 PM, Dean Pullen <de...@msp-uk.com>
wrote:
>> It's a bit odd, but I seem to have got it working finally.
>> I've set the messageStoreInterceptor before the portletDefaultStack.
>>
>> This threw an error about ItemView that having an input result - a
bit
>> odd considering it's the ItemEdit that needs the input result.
>>
>> I added this, and it magically works.
>>
>> Not sure this is the behaviour we'd expect, or even want - but it
>> certainly seems to work.
>>
>> I also added a <param name="title">${title}</param>, for each
relevant
>> param, to the input redirectAction to ensure the user's input was not
>> lost during the failed validation redirect.
>>
>> -----Original Message-----
>> From: Dean Pullen [mailto:dean.pullen@msp-uk.com]
>> Sent: 09 February 2009 19:31
>> To: Struts Users Mailing List
>> Subject: RE: Struts 2 Portlet Validation Problems
>>
>> I've tried, and reverted back for now, to using the
>> MessageStoreInterceptor with no success, the messages are still lost.
>> We've successfully used the MessageStoreInterceptor on non-portlet
>> applications.
>>
>> Annoyingly, anything you input on the form is also lost, which will
>> cause much chagrin for end-users.
>>
>> E.g.
>>           <action name="ItemView"
class="com.msp.portlets.ItemAction">
>>                        <interceptor-ref name="portletDefaultStack"/>
>>                        <interceptor-ref
name="messageStoreInterceptor">
>>                                <param
>> name="operationMode">RETRIEVE</param>
>>                        </interceptor-ref>
>>
>> <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>>                </action>
>>
>>                <action name="ItemEdit"
>> class="com.msp.portlets.ItemAction"
>>                                method="editItem">
>>                        <interceptor-ref name="portletDefaultStack"/>
>>                        <interceptor-ref
name="messageStoreInterceptor">
>>                                <param
>> name="operationMode">STORE</param>
>>                        </interceptor-ref>
>>                        <result type="redirectAction" name="success">
>>                                <param
>> name="actionName">ItemView</param>
>>                        </result>
>>                        <result type="redirectAction" name="input">
>>                                <param
>> name="actionName">ItemView</param>
>>                        </result>
>>                </action>
>>
>> Dean.
>>
>> -----Original Message-----
>> From: Musachy Barroso [mailto:musachy@gmail.com]
>> Sent: 09 February 2009 19:19
>> To: Struts Users Mailing List
>> Subject: Re: Struts 2 Portlet Validation Problems
>>
>> Messages will be lost if a redirectAction is used, unless the
>> MessageStoreInterceptor is used, or is that different in portlets
>> Nils?
>>
>> musachy
>>
>> On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen <de...@msp-uk.com>
>> wrote:
>>> I can confirm that using validation xml instead of annotations does
>>> exactly the same thing.
>>>
>>> i.e. a forward to a JSP will display the messages, a redirectAction
>> type
>>> result will 'lose' the messages during the dispatch.
>>>
>>> Dean.
>>>
>>> -----Original Message-----
>>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>>> Sent: 09 February 2009 18:07
>>> To: Struts Users Mailing List
>>> Subject: Re: Struts 2 Portlet Validation Problems
>>>
>>> Yeah, you're right... It's not using annotations. Have you tried
with
>>> xml validation? It's not a solution, but at least it will narrow
down
>>> the problem.
>>>
>>> Nils-H
>>>
>>> On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen <de...@msp-uk.com>
>>> wrote:
>>>> Nils-H,
>>>>
>>>> Thanks for the reply.
>>>>
>>>> I've looked at them - none of them actually use the annotations as
>>> such.
>>>>
>>>> It's definitely not working with or without MessageStoreInterceptor
>>> when
>>>> you utilise a redirect - it's absolutely fine if you simply replace
>>> the
>>>> redirect with a simple JSP result.
>>>>
>>>> Dean.
>>>>
>>>> -----Original Message-----
>>>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>>>> Sent: 09 February 2009 17:57
>>>> To: Struts Users Mailing List
>>>> Subject: Re: Struts 2 Portlet Validation Problems
>>>>
>>>> Have you tried installing the portlet sample app? I believe there
are
>>>> a couple of validation scenarios there. As far as I know, it should
>>>> work. You shouldn't even need the MessageStoreInterceptor, since
the
>>>> portlet default stack should handle preserving messages across
>>>> redirects.
>>>>
>>>> Nils-H
>>>>
>>>> On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen
<de...@msp-uk.com>
>>>> wrote:
>>>>> Hi all,
>>>>>
>>>>>
>>>>>
>>>>> We've been trying to get validation (using annotations) working
>>> within
>>>> a
>>>>> Struts Portlet for a couple of days - without success, when the
>> input
>>>> is
>>>>> a redirectAction.
>>>>>
>>>>> When the input result is a JSP, it works fine. We're using the
>>>>> messageStoreInterceptor.
>>>>>
>>>>>
>>>>>
>>>>> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>>>>>
>>>>>
>>>>>
>>>>> 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"/>
>>>>>
>>>>>
>>>>>                                                <interceptor-ref
>>>>> name="messageStoreInterceptor">
>>>>>
>>>>>
>> <param
>>>>> name="operationMode">RETRIEVE</param>
>>>>>
>>>>>                                                </interceptor-ref>
>>>>>
>>>>>
>>>>> <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"/>
>>>>>
>>>>>                                                <interceptor-ref
>>>>> name="messageStoreInterceptor">
>>>>>
>>>>>
>> <param
>>>>> name="operationMode">STORE</param>
>>>>>
>>>>>                                                </interceptor-ref>
>>>>>
>>>>>
>>>>>                                                <result
>>>>> type="redirectAction" name="success">
>>>>>
>>>>>
>> <param
>>>>> name="actionName">ItemView</param>
>>>>>
>>>>>
>> <param
>>>>> name="itemId">${itemId}</param>
>>>>>
>>>>>                                                </result>
>>>>>
>>>>>                                                <result
>>>>> type="redirectAction" name="input">
>>>>>
>>>>>
>> <param
>>>>> name="actionName"> ItemView </param>
>>>>>
>>>>> </result>
>>>>>
>>>>>                                </action>
>>>>>
>>>>>
>>>>>
>>>>> Does anyone know what the problem could be?
>>>>>
>>>>>
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>>
>>>>
>>>>
---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>> Scanned by MailDefender - managed email security from intY -
>>>> www.maildefender.net
>>>>
>>>>
---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>> Scanned by MailDefender - managed email security from intY -
>>> www.maildefender.net
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Portlet Validation Problems

Posted by Musachy Barroso <mu...@gmail.com>.
You can reopen the one I closed, and add any extra info you found.

musachy

On Mon, Feb 9, 2009 at 3:49 PM, Nils-Helge Garli Hegvik
<ni...@gmail.com> wrote:
> That should not be necessary. Could you please register a JIRA issue,
> and if possible, a simple app that can reproduce the issue?
>
> Thanks.
>
> Nils-H
>
> On Mon, Feb 9, 2009 at 9:09 PM, Dean Pullen <de...@msp-uk.com> wrote:
>> It's a bit odd, but I seem to have got it working finally.
>> I've set the messageStoreInterceptor before the portletDefaultStack.
>>
>> This threw an error about ItemView that having an input result - a bit
>> odd considering it's the ItemEdit that needs the input result.
>>
>> I added this, and it magically works.
>>
>> Not sure this is the behaviour we'd expect, or even want - but it
>> certainly seems to work.
>>
>> I also added a <param name="title">${title}</param>, for each relevant
>> param, to the input redirectAction to ensure the user's input was not
>> lost during the failed validation redirect.
>>
>> -----Original Message-----
>> From: Dean Pullen [mailto:dean.pullen@msp-uk.com]
>> Sent: 09 February 2009 19:31
>> To: Struts Users Mailing List
>> Subject: RE: Struts 2 Portlet Validation Problems
>>
>> I've tried, and reverted back for now, to using the
>> MessageStoreInterceptor with no success, the messages are still lost.
>> We've successfully used the MessageStoreInterceptor on non-portlet
>> applications.
>>
>> Annoyingly, anything you input on the form is also lost, which will
>> cause much chagrin for end-users.
>>
>> E.g.
>>           <action name="ItemView" class="com.msp.portlets.ItemAction">
>>                        <interceptor-ref name="portletDefaultStack"/>
>>                        <interceptor-ref name="messageStoreInterceptor">
>>                                <param
>> name="operationMode">RETRIEVE</param>
>>                        </interceptor-ref>
>>
>> <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>>                </action>
>>
>>                <action name="ItemEdit"
>> class="com.msp.portlets.ItemAction"
>>                                method="editItem">
>>                        <interceptor-ref name="portletDefaultStack"/>
>>                        <interceptor-ref name="messageStoreInterceptor">
>>                                <param
>> name="operationMode">STORE</param>
>>                        </interceptor-ref>
>>                        <result type="redirectAction" name="success">
>>                                <param
>> name="actionName">ItemView</param>
>>                        </result>
>>                        <result type="redirectAction" name="input">
>>                                <param
>> name="actionName">ItemView</param>
>>                        </result>
>>                </action>
>>
>> Dean.
>>
>> -----Original Message-----
>> From: Musachy Barroso [mailto:musachy@gmail.com]
>> Sent: 09 February 2009 19:19
>> To: Struts Users Mailing List
>> Subject: Re: Struts 2 Portlet Validation Problems
>>
>> Messages will be lost if a redirectAction is used, unless the
>> MessageStoreInterceptor is used, or is that different in portlets
>> Nils?
>>
>> musachy
>>
>> On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen <de...@msp-uk.com>
>> wrote:
>>> I can confirm that using validation xml instead of annotations does
>>> exactly the same thing.
>>>
>>> i.e. a forward to a JSP will display the messages, a redirectAction
>> type
>>> result will 'lose' the messages during the dispatch.
>>>
>>> Dean.
>>>
>>> -----Original Message-----
>>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>>> Sent: 09 February 2009 18:07
>>> To: Struts Users Mailing List
>>> Subject: Re: Struts 2 Portlet Validation Problems
>>>
>>> Yeah, you're right... It's not using annotations. Have you tried with
>>> xml validation? It's not a solution, but at least it will narrow down
>>> the problem.
>>>
>>> Nils-H
>>>
>>> On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen <de...@msp-uk.com>
>>> wrote:
>>>> Nils-H,
>>>>
>>>> Thanks for the reply.
>>>>
>>>> I've looked at them - none of them actually use the annotations as
>>> such.
>>>>
>>>> It's definitely not working with or without MessageStoreInterceptor
>>> when
>>>> you utilise a redirect - it's absolutely fine if you simply replace
>>> the
>>>> redirect with a simple JSP result.
>>>>
>>>> Dean.
>>>>
>>>> -----Original Message-----
>>>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>>>> Sent: 09 February 2009 17:57
>>>> To: Struts Users Mailing List
>>>> Subject: Re: Struts 2 Portlet Validation Problems
>>>>
>>>> Have you tried installing the portlet sample app? I believe there are
>>>> a couple of validation scenarios there. As far as I know, it should
>>>> work. You shouldn't even need the MessageStoreInterceptor, since the
>>>> portlet default stack should handle preserving messages across
>>>> redirects.
>>>>
>>>> Nils-H
>>>>
>>>> On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com>
>>>> wrote:
>>>>> Hi all,
>>>>>
>>>>>
>>>>>
>>>>> We've been trying to get validation (using annotations) working
>>> within
>>>> a
>>>>> Struts Portlet for a couple of days - without success, when the
>> input
>>>> is
>>>>> a redirectAction.
>>>>>
>>>>> When the input result is a JSP, it works fine. We're using the
>>>>> messageStoreInterceptor.
>>>>>
>>>>>
>>>>>
>>>>> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>>>>>
>>>>>
>>>>>
>>>>> 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"/>
>>>>>
>>>>>
>>>>>                                                <interceptor-ref
>>>>> name="messageStoreInterceptor">
>>>>>
>>>>>
>> <param
>>>>> name="operationMode">RETRIEVE</param>
>>>>>
>>>>>                                                </interceptor-ref>
>>>>>
>>>>>
>>>>> <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"/>
>>>>>
>>>>>                                                <interceptor-ref
>>>>> name="messageStoreInterceptor">
>>>>>
>>>>>
>> <param
>>>>> name="operationMode">STORE</param>
>>>>>
>>>>>                                                </interceptor-ref>
>>>>>
>>>>>
>>>>>                                                <result
>>>>> type="redirectAction" name="success">
>>>>>
>>>>>
>> <param
>>>>> name="actionName">ItemView</param>
>>>>>
>>>>>
>> <param
>>>>> name="itemId">${itemId}</param>
>>>>>
>>>>>                                                </result>
>>>>>
>>>>>                                                <result
>>>>> type="redirectAction" name="input">
>>>>>
>>>>>
>> <param
>>>>> name="actionName"> ItemView </param>
>>>>>
>>>>> </result>
>>>>>
>>>>>                                </action>
>>>>>
>>>>>
>>>>>
>>>>> Does anyone know what the problem could be?
>>>>>
>>>>>
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>> Scanned by MailDefender - managed email security from intY -
>>>> www.maildefender.net
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>> Scanned by MailDefender - managed email security from intY -
>>> www.maildefender.net
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Portlet Validation Problems

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
That should not be necessary. Could you please register a JIRA issue,
and if possible, a simple app that can reproduce the issue?

Thanks.

Nils-H

On Mon, Feb 9, 2009 at 9:09 PM, Dean Pullen <de...@msp-uk.com> wrote:
> It's a bit odd, but I seem to have got it working finally.
> I've set the messageStoreInterceptor before the portletDefaultStack.
>
> This threw an error about ItemView that having an input result - a bit
> odd considering it's the ItemEdit that needs the input result.
>
> I added this, and it magically works.
>
> Not sure this is the behaviour we'd expect, or even want - but it
> certainly seems to work.
>
> I also added a <param name="title">${title}</param>, for each relevant
> param, to the input redirectAction to ensure the user's input was not
> lost during the failed validation redirect.
>
> -----Original Message-----
> From: Dean Pullen [mailto:dean.pullen@msp-uk.com]
> Sent: 09 February 2009 19:31
> To: Struts Users Mailing List
> Subject: RE: Struts 2 Portlet Validation Problems
>
> I've tried, and reverted back for now, to using the
> MessageStoreInterceptor with no success, the messages are still lost.
> We've successfully used the MessageStoreInterceptor on non-portlet
> applications.
>
> Annoyingly, anything you input on the form is also lost, which will
> cause much chagrin for end-users.
>
> E.g.
>           <action name="ItemView" class="com.msp.portlets.ItemAction">
>                        <interceptor-ref name="portletDefaultStack"/>
>                        <interceptor-ref name="messageStoreInterceptor">
>                                <param
> name="operationMode">RETRIEVE</param>
>                        </interceptor-ref>
>
> <result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
>                </action>
>
>                <action name="ItemEdit"
> class="com.msp.portlets.ItemAction"
>                                method="editItem">
>                        <interceptor-ref name="portletDefaultStack"/>
>                        <interceptor-ref name="messageStoreInterceptor">
>                                <param
> name="operationMode">STORE</param>
>                        </interceptor-ref>
>                        <result type="redirectAction" name="success">
>                                <param
> name="actionName">ItemView</param>
>                        </result>
>                        <result type="redirectAction" name="input">
>                                <param
> name="actionName">ItemView</param>
>                        </result>
>                </action>
>
> Dean.
>
> -----Original Message-----
> From: Musachy Barroso [mailto:musachy@gmail.com]
> Sent: 09 February 2009 19:19
> To: Struts Users Mailing List
> Subject: Re: Struts 2 Portlet Validation Problems
>
> Messages will be lost if a redirectAction is used, unless the
> MessageStoreInterceptor is used, or is that different in portlets
> Nils?
>
> musachy
>
> On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen <de...@msp-uk.com>
> wrote:
>> I can confirm that using validation xml instead of annotations does
>> exactly the same thing.
>>
>> i.e. a forward to a JSP will display the messages, a redirectAction
> type
>> result will 'lose' the messages during the dispatch.
>>
>> Dean.
>>
>> -----Original Message-----
>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>> Sent: 09 February 2009 18:07
>> To: Struts Users Mailing List
>> Subject: Re: Struts 2 Portlet Validation Problems
>>
>> Yeah, you're right... It's not using annotations. Have you tried with
>> xml validation? It's not a solution, but at least it will narrow down
>> the problem.
>>
>> Nils-H
>>
>> On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen <de...@msp-uk.com>
>> wrote:
>>> Nils-H,
>>>
>>> Thanks for the reply.
>>>
>>> I've looked at them - none of them actually use the annotations as
>> such.
>>>
>>> It's definitely not working with or without MessageStoreInterceptor
>> when
>>> you utilise a redirect - it's absolutely fine if you simply replace
>> the
>>> redirect with a simple JSP result.
>>>
>>> Dean.
>>>
>>> -----Original Message-----
>>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>>> Sent: 09 February 2009 17:57
>>> To: Struts Users Mailing List
>>> Subject: Re: Struts 2 Portlet Validation Problems
>>>
>>> Have you tried installing the portlet sample app? I believe there are
>>> a couple of validation scenarios there. As far as I know, it should
>>> work. You shouldn't even need the MessageStoreInterceptor, since the
>>> portlet default stack should handle preserving messages across
>>> redirects.
>>>
>>> Nils-H
>>>
>>> On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com>
>>> wrote:
>>>> Hi all,
>>>>
>>>>
>>>>
>>>> We've been trying to get validation (using annotations) working
>> within
>>> a
>>>> Struts Portlet for a couple of days - without success, when the
> input
>>> is
>>>> a redirectAction.
>>>>
>>>> When the input result is a JSP, it works fine. We're using the
>>>> messageStoreInterceptor.
>>>>
>>>>
>>>>
>>>> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>>>>
>>>>
>>>>
>>>> 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"/>
>>>>
>>>>
>>>>                                                <interceptor-ref
>>>> name="messageStoreInterceptor">
>>>>
>>>>
> <param
>>>> name="operationMode">RETRIEVE</param>
>>>>
>>>>                                                </interceptor-ref>
>>>>
>>>>
>>>> <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"/>
>>>>
>>>>                                                <interceptor-ref
>>>> name="messageStoreInterceptor">
>>>>
>>>>
> <param
>>>> name="operationMode">STORE</param>
>>>>
>>>>                                                </interceptor-ref>
>>>>
>>>>
>>>>                                                <result
>>>> type="redirectAction" name="success">
>>>>
>>>>
> <param
>>>> name="actionName">ItemView</param>
>>>>
>>>>
> <param
>>>> name="itemId">${itemId}</param>
>>>>
>>>>                                                </result>
>>>>
>>>>                                                <result
>>>> type="redirectAction" name="input">
>>>>
>>>>
> <param
>>>> name="actionName"> ItemView </param>
>>>>
>>>> </result>
>>>>
>>>>                                </action>
>>>>
>>>>
>>>>
>>>> Does anyone know what the problem could be?
>>>>
>>>>
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>> Scanned by MailDefender - managed email security from intY -
>>> www.maildefender.net
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> Scanned by MailDefender - managed email security from intY -
> www.maildefender.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> Scanned by MailDefender - managed email security from intY -
> www.maildefender.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 2 Portlet Validation Problems

Posted by Dean Pullen <de...@msp-uk.com>.
It's a bit odd, but I seem to have got it working finally.
I've set the messageStoreInterceptor before the portletDefaultStack.

This threw an error about ItemView that having an input result - a bit
odd considering it's the ItemEdit that needs the input result.

I added this, and it magically works.

Not sure this is the behaviour we'd expect, or even want - but it
certainly seems to work.

I also added a <param name="title">${title}</param>, for each relevant
param, to the input redirectAction to ensure the user's input was not
lost during the failed validation redirect.

-----Original Message-----
From: Dean Pullen [mailto:dean.pullen@msp-uk.com] 
Sent: 09 February 2009 19:31
To: Struts Users Mailing List
Subject: RE: Struts 2 Portlet Validation Problems

I've tried, and reverted back for now, to using the
MessageStoreInterceptor with no success, the messages are still lost.
We've successfully used the MessageStoreInterceptor on non-portlet
applications.

Annoyingly, anything you input on the form is also lost, which will
cause much chagrin for end-users.

E.g.
           <action name="ItemView" class="com.msp.portlets.ItemAction">
			<interceptor-ref name="portletDefaultStack"/>
			<interceptor-ref name="messageStoreInterceptor">
				<param
name="operationMode">RETRIEVE</param>
			</interceptor-ref>
	
<result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
		</action>

		<action name="ItemEdit"
class="com.msp.portlets.ItemAction"
				method="editItem">
			<interceptor-ref name="portletDefaultStack"/>
			<interceptor-ref name="messageStoreInterceptor">
				<param
name="operationMode">STORE</param>
			</interceptor-ref>
			<result type="redirectAction" name="success">
				<param
name="actionName">ItemView</param>
			</result>
			<result type="redirectAction" name="input">
				<param
name="actionName">ItemView</param>
			</result>
		</action>

Dean.

-----Original Message-----
From: Musachy Barroso [mailto:musachy@gmail.com] 
Sent: 09 February 2009 19:19
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet Validation Problems

Messages will be lost if a redirectAction is used, unless the
MessageStoreInterceptor is used, or is that different in portlets
Nils?

musachy

On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen <de...@msp-uk.com>
wrote:
> I can confirm that using validation xml instead of annotations does
> exactly the same thing.
>
> i.e. a forward to a JSP will display the messages, a redirectAction
type
> result will 'lose' the messages during the dispatch.
>
> Dean.
>
> -----Original Message-----
> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
> Sent: 09 February 2009 18:07
> To: Struts Users Mailing List
> Subject: Re: Struts 2 Portlet Validation Problems
>
> Yeah, you're right... It's not using annotations. Have you tried with
> xml validation? It's not a solution, but at least it will narrow down
> the problem.
>
> Nils-H
>
> On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen <de...@msp-uk.com>
> wrote:
>> Nils-H,
>>
>> Thanks for the reply.
>>
>> I've looked at them - none of them actually use the annotations as
> such.
>>
>> It's definitely not working with or without MessageStoreInterceptor
> when
>> you utilise a redirect - it's absolutely fine if you simply replace
> the
>> redirect with a simple JSP result.
>>
>> Dean.
>>
>> -----Original Message-----
>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>> Sent: 09 February 2009 17:57
>> To: Struts Users Mailing List
>> Subject: Re: Struts 2 Portlet Validation Problems
>>
>> Have you tried installing the portlet sample app? I believe there are
>> a couple of validation scenarios there. As far as I know, it should
>> work. You shouldn't even need the MessageStoreInterceptor, since the
>> portlet default stack should handle preserving messages across
>> redirects.
>>
>> Nils-H
>>
>> On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com>
>> wrote:
>>> Hi all,
>>>
>>>
>>>
>>> We've been trying to get validation (using annotations) working
> within
>> a
>>> Struts Portlet for a couple of days - without success, when the
input
>> is
>>> a redirectAction.
>>>
>>> When the input result is a JSP, it works fine. We're using the
>>> messageStoreInterceptor.
>>>
>>>
>>>
>>> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>>>
>>>
>>>
>>> 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"/>
>>>
>>>
>>>                                                <interceptor-ref
>>> name="messageStoreInterceptor">
>>>
>>>
<param
>>> name="operationMode">RETRIEVE</param>
>>>
>>>                                                </interceptor-ref>
>>>
>>>
>>> <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"/>
>>>
>>>                                                <interceptor-ref
>>> name="messageStoreInterceptor">
>>>
>>>
<param
>>> name="operationMode">STORE</param>
>>>
>>>                                                </interceptor-ref>
>>>
>>>
>>>                                                <result
>>> type="redirectAction" name="success">
>>>
>>>
<param
>>> name="actionName">ItemView</param>
>>>
>>>
<param
>>> name="itemId">${itemId}</param>
>>>
>>>                                                </result>
>>>
>>>                                                <result
>>> type="redirectAction" name="input">
>>>
>>>
<param
>>> name="actionName"> ItemView </param>
>>>
>>> </result>
>>>
>>>                                </action>
>>>
>>>
>>>
>>> Does anyone know what the problem could be?
>>>
>>>
>>>
>>> Thanks in advance.
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> Scanned by MailDefender - managed email security from intY -
> www.maildefender.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 2 Portlet Validation Problems

Posted by Dean Pullen <de...@msp-uk.com>.
I've tried, and reverted back for now, to using the
MessageStoreInterceptor with no success, the messages are still lost.
We've successfully used the MessageStoreInterceptor on non-portlet
applications.

Annoyingly, anything you input on the form is also lost, which will
cause much chagrin for end-users.

E.g.
           <action name="ItemView" class="com.msp.portlets.ItemAction">
			<interceptor-ref name="portletDefaultStack"/>
			<interceptor-ref name="messageStoreInterceptor">
				<param
name="operationMode">RETRIEVE</param>
			</interceptor-ref>
	
<result>/WEB-INF/jsp/welcome/admin/item.jsp</result>
		</action>

		<action name="ItemEdit"
class="com.msp.portlets.ItemAction"
				method="editItem">
			<interceptor-ref name="portletDefaultStack"/>
			<interceptor-ref name="messageStoreInterceptor">
				<param
name="operationMode">STORE</param>
			</interceptor-ref>
			<result type="redirectAction" name="success">
				<param
name="actionName">ItemView</param>
			</result>
			<result type="redirectAction" name="input">
				<param
name="actionName">ItemView</param>
			</result>
		</action>

Dean.

-----Original Message-----
From: Musachy Barroso [mailto:musachy@gmail.com] 
Sent: 09 February 2009 19:19
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet Validation Problems

Messages will be lost if a redirectAction is used, unless the
MessageStoreInterceptor is used, or is that different in portlets
Nils?

musachy

On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen <de...@msp-uk.com>
wrote:
> I can confirm that using validation xml instead of annotations does
> exactly the same thing.
>
> i.e. a forward to a JSP will display the messages, a redirectAction
type
> result will 'lose' the messages during the dispatch.
>
> Dean.
>
> -----Original Message-----
> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
> Sent: 09 February 2009 18:07
> To: Struts Users Mailing List
> Subject: Re: Struts 2 Portlet Validation Problems
>
> Yeah, you're right... It's not using annotations. Have you tried with
> xml validation? It's not a solution, but at least it will narrow down
> the problem.
>
> Nils-H
>
> On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen <de...@msp-uk.com>
> wrote:
>> Nils-H,
>>
>> Thanks for the reply.
>>
>> I've looked at them - none of them actually use the annotations as
> such.
>>
>> It's definitely not working with or without MessageStoreInterceptor
> when
>> you utilise a redirect - it's absolutely fine if you simply replace
> the
>> redirect with a simple JSP result.
>>
>> Dean.
>>
>> -----Original Message-----
>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>> Sent: 09 February 2009 17:57
>> To: Struts Users Mailing List
>> Subject: Re: Struts 2 Portlet Validation Problems
>>
>> Have you tried installing the portlet sample app? I believe there are
>> a couple of validation scenarios there. As far as I know, it should
>> work. You shouldn't even need the MessageStoreInterceptor, since the
>> portlet default stack should handle preserving messages across
>> redirects.
>>
>> Nils-H
>>
>> On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com>
>> wrote:
>>> Hi all,
>>>
>>>
>>>
>>> We've been trying to get validation (using annotations) working
> within
>> a
>>> Struts Portlet for a couple of days - without success, when the
input
>> is
>>> a redirectAction.
>>>
>>> When the input result is a JSP, it works fine. We're using the
>>> messageStoreInterceptor.
>>>
>>>
>>>
>>> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>>>
>>>
>>>
>>> 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"/>
>>>
>>>
>>>                                                <interceptor-ref
>>> name="messageStoreInterceptor">
>>>
>>>
<param
>>> name="operationMode">RETRIEVE</param>
>>>
>>>                                                </interceptor-ref>
>>>
>>>
>>> <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"/>
>>>
>>>                                                <interceptor-ref
>>> name="messageStoreInterceptor">
>>>
>>>
<param
>>> name="operationMode">STORE</param>
>>>
>>>                                                </interceptor-ref>
>>>
>>>
>>>                                                <result
>>> type="redirectAction" name="success">
>>>
>>>
<param
>>> name="actionName">ItemView</param>
>>>
>>>
<param
>>> name="itemId">${itemId}</param>
>>>
>>>                                                </result>
>>>
>>>                                                <result
>>> type="redirectAction" name="input">
>>>
>>>
<param
>>> name="actionName"> ItemView </param>
>>>
>>> </result>
>>>
>>>                                </action>
>>>
>>>
>>>
>>> Does anyone know what the problem could be?
>>>
>>>
>>>
>>> Thanks in advance.
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> Scanned by MailDefender - managed email security from intY -
> www.maildefender.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Portlet Validation Problems

Posted by Musachy Barroso <mu...@gmail.com>.
Messages will be lost if a redirectAction is used, unless the
MessageStoreInterceptor is used, or is that different in portlets
Nils?

musachy

On Mon, Feb 9, 2009 at 1:54 PM, Dean Pullen <de...@msp-uk.com> wrote:
> I can confirm that using validation xml instead of annotations does
> exactly the same thing.
>
> i.e. a forward to a JSP will display the messages, a redirectAction type
> result will 'lose' the messages during the dispatch.
>
> Dean.
>
> -----Original Message-----
> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
> Sent: 09 February 2009 18:07
> To: Struts Users Mailing List
> Subject: Re: Struts 2 Portlet Validation Problems
>
> Yeah, you're right... It's not using annotations. Have you tried with
> xml validation? It's not a solution, but at least it will narrow down
> the problem.
>
> Nils-H
>
> On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen <de...@msp-uk.com>
> wrote:
>> Nils-H,
>>
>> Thanks for the reply.
>>
>> I've looked at them - none of them actually use the annotations as
> such.
>>
>> It's definitely not working with or without MessageStoreInterceptor
> when
>> you utilise a redirect - it's absolutely fine if you simply replace
> the
>> redirect with a simple JSP result.
>>
>> Dean.
>>
>> -----Original Message-----
>> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
>> Sent: 09 February 2009 17:57
>> To: Struts Users Mailing List
>> Subject: Re: Struts 2 Portlet Validation Problems
>>
>> Have you tried installing the portlet sample app? I believe there are
>> a couple of validation scenarios there. As far as I know, it should
>> work. You shouldn't even need the MessageStoreInterceptor, since the
>> portlet default stack should handle preserving messages across
>> redirects.
>>
>> Nils-H
>>
>> On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com>
>> wrote:
>>> Hi all,
>>>
>>>
>>>
>>> We've been trying to get validation (using annotations) working
> within
>> a
>>> Struts Portlet for a couple of days - without success, when the input
>> is
>>> a redirectAction.
>>>
>>> When the input result is a JSP, it works fine. We're using the
>>> messageStoreInterceptor.
>>>
>>>
>>>
>>> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>>>
>>>
>>>
>>> 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"/>
>>>
>>>
>>>                                                <interceptor-ref
>>> name="messageStoreInterceptor">
>>>
>>>                                                                <param
>>> name="operationMode">RETRIEVE</param>
>>>
>>>                                                </interceptor-ref>
>>>
>>>
>>> <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"/>
>>>
>>>                                                <interceptor-ref
>>> name="messageStoreInterceptor">
>>>
>>>                                                                <param
>>> name="operationMode">STORE</param>
>>>
>>>                                                </interceptor-ref>
>>>
>>>
>>>                                                <result
>>> type="redirectAction" name="success">
>>>
>>>                                                                <param
>>> name="actionName">ItemView</param>
>>>
>>>                                                                <param
>>> name="itemId">${itemId}</param>
>>>
>>>                                                </result>
>>>
>>>                                                <result
>>> type="redirectAction" name="input">
>>>
>>>                                                                <param
>>> name="actionName"> ItemView </param>
>>>
>>> </result>
>>>
>>>                                </action>
>>>
>>>
>>>
>>> Does anyone know what the problem could be?
>>>
>>>
>>>
>>> Thanks in advance.
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> Scanned by MailDefender - managed email security from intY -
>> www.maildefender.net
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> Scanned by MailDefender - managed email security from intY -
> www.maildefender.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 2 Portlet Validation Problems

Posted by Dean Pullen <de...@msp-uk.com>.
I can confirm that using validation xml instead of annotations does
exactly the same thing.

i.e. a forward to a JSP will display the messages, a redirectAction type
result will 'lose' the messages during the dispatch.

Dean.

-----Original Message-----
From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com] 
Sent: 09 February 2009 18:07
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet Validation Problems

Yeah, you're right... It's not using annotations. Have you tried with
xml validation? It's not a solution, but at least it will narrow down
the problem.

Nils-H

On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen <de...@msp-uk.com>
wrote:
> Nils-H,
>
> Thanks for the reply.
>
> I've looked at them - none of them actually use the annotations as
such.
>
> It's definitely not working with or without MessageStoreInterceptor
when
> you utilise a redirect - it's absolutely fine if you simply replace
the
> redirect with a simple JSP result.
>
> Dean.
>
> -----Original Message-----
> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
> Sent: 09 February 2009 17:57
> To: Struts Users Mailing List
> Subject: Re: Struts 2 Portlet Validation Problems
>
> Have you tried installing the portlet sample app? I believe there are
> a couple of validation scenarios there. As far as I know, it should
> work. You shouldn't even need the MessageStoreInterceptor, since the
> portlet default stack should handle preserving messages across
> redirects.
>
> Nils-H
>
> On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com>
> wrote:
>> Hi all,
>>
>>
>>
>> We've been trying to get validation (using annotations) working
within
> a
>> Struts Portlet for a couple of days - without success, when the input
> is
>> a redirectAction.
>>
>> When the input result is a JSP, it works fine. We're using the
>> messageStoreInterceptor.
>>
>>
>>
>> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>>
>>
>>
>> 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"/>
>>
>>
>>                                                <interceptor-ref
>> name="messageStoreInterceptor">
>>
>>                                                                <param
>> name="operationMode">RETRIEVE</param>
>>
>>                                                </interceptor-ref>
>>
>>
>> <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"/>
>>
>>                                                <interceptor-ref
>> name="messageStoreInterceptor">
>>
>>                                                                <param
>> name="operationMode">STORE</param>
>>
>>                                                </interceptor-ref>
>>
>>
>>                                                <result
>> type="redirectAction" name="success">
>>
>>                                                                <param
>> name="actionName">ItemView</param>
>>
>>                                                                <param
>> name="itemId">${itemId}</param>
>>
>>                                                </result>
>>
>>                                                <result
>> type="redirectAction" name="input">
>>
>>                                                                <param
>> name="actionName"> ItemView </param>
>>
>> </result>
>>
>>                                </action>
>>
>>
>>
>> Does anyone know what the problem could be?
>>
>>
>>
>> Thanks in advance.
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> Scanned by MailDefender - managed email security from intY -
> www.maildefender.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 2 Portlet Validation Problems

Posted by Dean Pullen <de...@msp-uk.com>.
Rechecking and it seems none of them use a redirect as the input either,
which is the main test case I'm after really.

-----Original Message-----
From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com] 
Sent: 09 February 2009 18:07
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet Validation Problems

Yeah, you're right... It's not using annotations. Have you tried with
xml validation? It's not a solution, but at least it will narrow down
the problem.

Nils-H

On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen <de...@msp-uk.com>
wrote:
> Nils-H,
>
> Thanks for the reply.
>
> I've looked at them - none of them actually use the annotations as
such.
>
> It's definitely not working with or without MessageStoreInterceptor
when
> you utilise a redirect - it's absolutely fine if you simply replace
the
> redirect with a simple JSP result.
>
> Dean.
>
> -----Original Message-----
> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
> Sent: 09 February 2009 17:57
> To: Struts Users Mailing List
> Subject: Re: Struts 2 Portlet Validation Problems
>
> Have you tried installing the portlet sample app? I believe there are
> a couple of validation scenarios there. As far as I know, it should
> work. You shouldn't even need the MessageStoreInterceptor, since the
> portlet default stack should handle preserving messages across
> redirects.
>
> Nils-H
>
> On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com>
> wrote:
>> Hi all,
>>
>>
>>
>> We've been trying to get validation (using annotations) working
within
> a
>> Struts Portlet for a couple of days - without success, when the input
> is
>> a redirectAction.
>>
>> When the input result is a JSP, it works fine. We're using the
>> messageStoreInterceptor.
>>
>>
>>
>> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>>
>>
>>
>> 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"/>
>>
>>
>>                                                <interceptor-ref
>> name="messageStoreInterceptor">
>>
>>                                                                <param
>> name="operationMode">RETRIEVE</param>
>>
>>                                                </interceptor-ref>
>>
>>
>> <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"/>
>>
>>                                                <interceptor-ref
>> name="messageStoreInterceptor">
>>
>>                                                                <param
>> name="operationMode">STORE</param>
>>
>>                                                </interceptor-ref>
>>
>>
>>                                                <result
>> type="redirectAction" name="success">
>>
>>                                                                <param
>> name="actionName">ItemView</param>
>>
>>                                                                <param
>> name="itemId">${itemId}</param>
>>
>>                                                </result>
>>
>>                                                <result
>> type="redirectAction" name="input">
>>
>>                                                                <param
>> name="actionName"> ItemView </param>
>>
>> </result>
>>
>>                                </action>
>>
>>
>>
>> Does anyone know what the problem could be?
>>
>>
>>
>> Thanks in advance.
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> Scanned by MailDefender - managed email security from intY -
> www.maildefender.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Portlet Validation Problems

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
Yeah, you're right... It's not using annotations. Have you tried with
xml validation? It's not a solution, but at least it will narrow down
the problem.

Nils-H

On Mon, Feb 9, 2009 at 7:00 PM, Dean Pullen <de...@msp-uk.com> wrote:
> Nils-H,
>
> Thanks for the reply.
>
> I've looked at them - none of them actually use the annotations as such.
>
> It's definitely not working with or without MessageStoreInterceptor when
> you utilise a redirect - it's absolutely fine if you simply replace the
> redirect with a simple JSP result.
>
> Dean.
>
> -----Original Message-----
> From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com]
> Sent: 09 February 2009 17:57
> To: Struts Users Mailing List
> Subject: Re: Struts 2 Portlet Validation Problems
>
> Have you tried installing the portlet sample app? I believe there are
> a couple of validation scenarios there. As far as I know, it should
> work. You shouldn't even need the MessageStoreInterceptor, since the
> portlet default stack should handle preserving messages across
> redirects.
>
> Nils-H
>
> On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com>
> wrote:
>> Hi all,
>>
>>
>>
>> We've been trying to get validation (using annotations) working within
> a
>> Struts Portlet for a couple of days - without success, when the input
> is
>> a redirectAction.
>>
>> When the input result is a JSP, it works fine. We're using the
>> messageStoreInterceptor.
>>
>>
>>
>> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>>
>>
>>
>> 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"/>
>>
>>
>>                                                <interceptor-ref
>> name="messageStoreInterceptor">
>>
>>                                                                <param
>> name="operationMode">RETRIEVE</param>
>>
>>                                                </interceptor-ref>
>>
>>
>> <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"/>
>>
>>                                                <interceptor-ref
>> name="messageStoreInterceptor">
>>
>>                                                                <param
>> name="operationMode">STORE</param>
>>
>>                                                </interceptor-ref>
>>
>>
>>                                                <result
>> type="redirectAction" name="success">
>>
>>                                                                <param
>> name="actionName">ItemView</param>
>>
>>                                                                <param
>> name="itemId">${itemId}</param>
>>
>>                                                </result>
>>
>>                                                <result
>> type="redirectAction" name="input">
>>
>>                                                                <param
>> name="actionName"> ItemView </param>
>>
>> </result>
>>
>>                                </action>
>>
>>
>>
>> Does anyone know what the problem could be?
>>
>>
>>
>> Thanks in advance.
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> Scanned by MailDefender - managed email security from intY -
> www.maildefender.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Struts 2 Portlet Validation Problems

Posted by Dean Pullen <de...@msp-uk.com>.
Nils-H,

Thanks for the reply.

I've looked at them - none of them actually use the annotations as such.

It's definitely not working with or without MessageStoreInterceptor when
you utilise a redirect - it's absolutely fine if you simply replace the
redirect with a simple JSP result.

Dean.

-----Original Message-----
From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com] 
Sent: 09 February 2009 17:57
To: Struts Users Mailing List
Subject: Re: Struts 2 Portlet Validation Problems

Have you tried installing the portlet sample app? I believe there are
a couple of validation scenarios there. As far as I know, it should
work. You shouldn't even need the MessageStoreInterceptor, since the
portlet default stack should handle preserving messages across
redirects.

Nils-H

On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com>
wrote:
> Hi all,
>
>
>
> We've been trying to get validation (using annotations) working within
a
> Struts Portlet for a couple of days - without success, when the input
is
> a redirectAction.
>
> When the input result is a JSP, it works fine. We're using the
> messageStoreInterceptor.
>
>
>
> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>
>
>
> 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"/>
>
>
>                                                <interceptor-ref
> name="messageStoreInterceptor">
>
>                                                                <param
> name="operationMode">RETRIEVE</param>
>
>                                                </interceptor-ref>
>
>
> <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"/>
>
>                                                <interceptor-ref
> name="messageStoreInterceptor">
>
>                                                                <param
> name="operationMode">STORE</param>
>
>                                                </interceptor-ref>
>
>
>                                                <result
> type="redirectAction" name="success">
>
>                                                                <param
> name="actionName">ItemView</param>
>
>                                                                <param
> name="itemId">${itemId}</param>
>
>                                                </result>
>
>                                                <result
> type="redirectAction" name="input">
>
>                                                                <param
> name="actionName"> ItemView </param>
>
> </result>
>
>                                </action>
>
>
>
> Does anyone know what the problem could be?
>
>
>
> Thanks in advance.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Scanned by MailDefender - managed email security from intY -
www.maildefender.net

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Portlet Validation Problems

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
Have you tried installing the portlet sample app? I believe there are
a couple of validation scenarios there. As far as I know, it should
work. You shouldn't even need the MessageStoreInterceptor, since the
portlet default stack should handle preserving messages across
redirects.

Nils-H

On Mon, Feb 9, 2009 at 6:33 PM, Dean Pullen <de...@msp-uk.com> wrote:
> Hi all,
>
>
>
> We've been trying to get validation (using annotations) working within a
> Struts Portlet for a couple of days - without success, when the input is
> a redirectAction.
>
> When the input result is a JSP, it works fine. We're using the
> messageStoreInterceptor.
>
>
>
> We're using JBoss Portal 2.7.1 and Struts 2.1.6.
>
>
>
> 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"/>
>
>
>                                                <interceptor-ref
> name="messageStoreInterceptor">
>
>                                                                <param
> name="operationMode">RETRIEVE</param>
>
>                                                </interceptor-ref>
>
>
> <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"/>
>
>                                                <interceptor-ref
> name="messageStoreInterceptor">
>
>                                                                <param
> name="operationMode">STORE</param>
>
>                                                </interceptor-ref>
>
>
>                                                <result
> type="redirectAction" name="success">
>
>                                                                <param
> name="actionName">ItemView</param>
>
>                                                                <param
> name="itemId">${itemId}</param>
>
>                                                </result>
>
>                                                <result
> type="redirectAction" name="input">
>
>                                                                <param
> name="actionName"> ItemView </param>
>
> </result>
>
>                                </action>
>
>
>
> Does anyone know what the problem could be?
>
>
>
> Thanks in advance.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org