I was including the hidden fields in the base.jsp that all my tiles extend.
The reason the

result name="input"     type="tiles">${#parameters.tile}</result>

was not being populated is because the hidden fields were NOT in the
specific form that was being POST'ed.  In order for this to work, developers
would have to *remember* to add these hidden fields to all their page
forms!  Gross!!!  Is there a better way to do this?  The hidden fields are
in the HTML, just not part of the request.  Can they be fished from the
ValueStack some other way?

Better yet, is the org.apache.struts2.tiles.StrutsTilesListener stashing the
tiles definition someplace?  This seems like a framework issue relating to
restoring target result if validation fails.

Scott

On 5/2/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:

I'm not sure what that error is, but you can use OGNL expression on
results,
using ${expression}, and the request parameters are available in
#parameters, so yes, it should work :)

musachy

On 5/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Are you sure about this technique?  I have the hidden field in my page
and
> I
> can see that it is set to the correct string, however, when this page is
> POSTed, I get the following error.  It appears that the hidden field is
> not
> quite making it into the struts.xml result.
>
>
> 15:04:38,762  WARN org.apache.tiles.impl.BasicTilesContainer.render:368
-
> Unable to find the definition ''
> May 2, 2007 3:04:38 PM
org.apache.catalina.core.StandardWrapperValveinvoke
> SEVERE: Servlet.service() for servlet default threw exception
> org.apache.tiles.definition.NoSuchDefinitionException:
>
> On 5/2/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
> >
> > Struts never knows what is *the page* that failed. The action gets an
> http
> > request, but it doesn't know what was the page, with the submit in it,
> > that
> > caused the request. You can pass a hidden field with the name of the
> > page(let's say "inputPage"), and then have a result like this:
> >
> > <result name="input"
> >            type="tiles">
> >            ${#parameters.inputPage}
> > </result>
> >
> > musachy
> >
> > On 5/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > >
> > > How do I get the Action input to return to *the* page that failed
the
> > > validation?  It could be addPage, UpdatePage, or deletePage.
> > >
> > > <result name="input"
> > >             type="tiles">
> > >             *_tileThatFailedValidation_*
> > > </result>
> > >
> > > --
> > > Scott
> > > [EMAIL PROTECTED]
> > >
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>
>
>
> --
> Scott
> [EMAIL PROTECTED]
>



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




--
Scott
[EMAIL PROTECTED]

Reply via email to