Matt,

  This makes it sound like something I'm doing, and I will double check that
again.  Potentially the request parameter isn't being set correctly.  Yes
I'm saying that editPerson.html isn't in all cases being passed the
id=<value> parameter.  In some cases the id is coming across as a request
parameter but I have to admit I need to pay more attention to what links
produce which urls.  I am getting the id before I call out to process an
action, when I call out to process any action the id parameter is null for
me and to get around this I'm using the session.  If you can provide any
more insight that would be great.  If not I can take this offline because
it's starting to look like I introduced a bug when going through the
tutorial.

Thanks,

Ryan

On Thu, May 1, 2008 at 11:26 AM, Matt Raible <[EMAIL PROTECTED]> wrote:

> You're saying that /editPerson.html?id=1 results in a null value in
> the hidden field?
>
> Matt
>
> On Thu, May 1, 2008 at 10:10 AM, Ryan Withers <[EMAIL PROTECTED]>
> wrote:
> > Matt,
> >
> >   The id does get set, but when the action methods get performed either
> > (edit, save, delete) the id is being set back to null.
> >
> > Thanks,
> >
> > Ryan
> >
> >
> >
> > On Thu, May 1, 2008 at 11:04 AM, Matt Raible <[EMAIL PROTECTED]>
> wrote:
> >
> > >
> > >
> > >
> > > The id should be a hidden field so it's retained on an edit. The
> > > tutorial shows this:
> > >
> > > <s:hidden name="person.id" value="%{person.id}"/>
> > >
> > > Matt
> > >
> > >
> > >
> > >
> > > On Thu, May 1, 2008 at 9:58 AM, Ryan Withers <[EMAIL PROTECTED]>
> > wrote:
> > > > Matt,
> > > >
> > > >   In the posted example for the Struts 2 project there seems to be
> an
> > issue
> > > > with the PersonAction where things are done in terms of the id on
> the
> > > > action.  Trouble is this gets set, and then on a subsequent request
> it
> > winds
> > > > up being null.  So the call to save always creates a new row in the
> > table.
> > > > I solved this by storing the id in the session when the setter setId
> > gets
> > > > called.  In fact many of the methods in the PersonAction now look
> for
> > the id
> > > > being in the session vs. just looking at the instance id variable.
>  Am I
> > > > losing my mind or should the example be updated?
> > > >
> > > > Thanks,
> > > >
> > > > Ryan
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to