No problem, will do - in the morning! Thanks.
-----Original Message----- From: Musachy Barroso [mailto:musa...@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 <nil...@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 <dean.pul...@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.pul...@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:musa...@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 <dean.pul...@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:nil...@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 <dean.pul...@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:nil...@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 <dean.pul...@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-unsubscr...@struts.apache.org >>>> For additional commands, e-mail: user-h...@struts.apache.org >>>> >>>> >>>> Scanned by MailDefender - managed email security from intY - >>>> www.maildefender.net >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>>> For additional commands, e-mail: user-h...@struts.apache.org >>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>> For additional commands, e-mail: user-h...@struts.apache.org >>> >>> >>> Scanned by MailDefender - managed email security from intY - >>> www.maildefender.net >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >>> For additional commands, e-mail: user-h...@struts.apache.org >>> >>> >> >> >> >> -- >> "Hey you! Would you help me to carry the stone?" Pink Floyd >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> >> Scanned by MailDefender - managed email security from intY - >> www.maildefender.net >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> >> Scanned by MailDefender - managed email security from intY - >> www.maildefender.net >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Scanned by MailDefender - managed email security from intY - www.maildefender.net --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org