You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Juan Medín Piñeiro <ju...@gmail.com> on 2005/10/21 14:42:08 UTC

Re: Can't get x:saveState to work

Hi Mark,

    I'm having the same problem with some simple test jsp files like
yours, Could you explain what solution have you found for it ?

Thanks,

    - Juancho

On 9/9/05, Mike Kienenberger <mk...@gmail.com> wrote:
> I recommend keeping questions on the mailing list so others can
> comment as well.  Also, other people may have the same questions as
> you do.
>
> 1) Don't have any suggestions yet, but I'll have to figure out an
> answer at some point for my own projects.
>
> 1a) Yes, adding a redirect will break saveState.   This is because
> you're throwing away all of the state information when you perform a
> redirect.   If there's any state information you need to save over a
> redirect, you'll have to manually put it into your HttpSession, then
> retrieve it.  It's probably best to avoid redirects where this is an
> issue.
>
> 2) Yes, I use saveState a great deal.  I consider it an essential JSF tool.
>
> You're already using the tomahawk version.   x:saveState and
> t:saveState are just two different names for the same thing.   the x
> format is the old naming convention and the t format is the new naming
> convention.
>
> Best practices?  Avoid redirects if the next page depends on the last
> page.   Keep the amount of data saved small :)   Mark unimportant or
> recreatable data as transient (assuming you're using Serializable) or
> don't save it (if you're using StateHolder).
>
> On 9/9/05, Strecker, Mark <pe...@ugs.com> wrote:
> > 1) When you refresh a page, the request is re-submitted. Is there an
> > easy way to detect this during the submit? We are protected on the
> > backend so that the same data won't be saved in the db again, but it
> > would be better to detect this before getting a hibernate exception.
> > 1a) Changing to redirect in the navigation fixes this, but then
> > saveState doesn't work.
> > 2) Do you use saveState? Should we use the Tomahawk version? Do you have
> > any best practices on using saveState?
> >
> > Thanks,
> > Mark
> >
> > -----Original Message-----
> > >  ________________________________
> > >  From: Strecker, Mark [mailto:pestreck@ugs.com]
> > > Sent: Thursday, September 08, 2005 11:14 AM
> > > To: users@myfaces.apache.org
> > > Subject: Can't get x:saveState to work
> > >
> > >
> > >
> > >
> > > Hello All,
> > >
> > >    We are having problems getting x:saveState(or for that matter using
> >
> > > Tomahawk's t:saveState) to work in the scenario where a bean's values
> > > are persisted from one page to the next. I made a simple test app
> > > where page1 and page2 are identical. I set a value in the page1's
> > > form, submit it, then go to page2 and the values are gone.
> > >
> > >    I have seen many posts saying that this should work and that people
> >
> > > are using this, but we need some help figuring out what we did wrong.
> > >
> > > TIA,
> > > Mark
> > >
> > > Here are my files :
> > > <<Test.jsp>> <<Test2.jsp>> <<faces-config.xml>> <<web.xml>>
> > > <<TestForm.java>>
> >
>