You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by kal stevens <ka...@gmail.com> on 2007/02/02 19:08:14 UTC

Old error messages on a redirected page

I have a page that is redirected in faces-config.xml file

And my problem is that on this page, if the user gives an invalid input
there is an error message.
I would like it if when the user refreshes the page (or hits a back
breadcrumb) if that error message was not displayed again.

Is there a better way to do this?
The page can not resubmit the action, so I had to do a redirect.

Thanks

Kal

Re: Old error messages on a redirected page

Posted by kal stevens <ka...@gmail.com>.
Sorry I think I misstated the problem, and got mixed up from a different
problem I am having.

I have a page that edits a bean, and at the bottom of the page the user can
submit the bean to save to the database.
Or the user can delete the bean.

Then a message "XXX has been deleted successfully." is displayed to the
user.

Our application has breadcrumbs but the problem exists when a user reloads a
page by pressing the refresh button.

Previously when the user would reload the page the application would attempt
to delete the item again, so I read online and it said that I should use a
redirect.

When I do that, it no longer performs the action to get to that page but the
"XXX has been deleted successfully." is still displayed to the user.

I used a debugger to verify that it does not go into the action after the
redirect.

But this error message is misleading to the user.

Thanks

Kal



On 2/5/07, Jay Balunas <ba...@gmail.com> wrote:
>
> Hello Kal,
>
> I trying to understand you issue a little more.  You have something like a
> login page that upon successful login redirects to another page?  If there
> is an error it is displayed on the login page?  But if the use has invalid
> login information entered, but clicks a command button to navigate to
> another page the error still displays on the new page?
>
> Is the error caused by a validator/converter, or with-in an action
> method?  Because this type of functionality is alot like a "cancel" button -
> you want it to navigate, but not process validations.
>
> This myfaces wiki page talks about one solution ( wiki )<http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works>Using the immediate attribute on command components.
>
> -Jay
>
> On 2/2/07, kal stevens <ka...@gmail.com> wrote:
> >
> > I have a page that is redirected in faces-config.xml file
> >
> > And my problem is that on this page, if the user gives an invalid input
> > there is an error message.
> > I would like it if when the user refreshes the page (or hits a back
> > breadcrumb) if that error message was not displayed again.
> >
> > Is there a better way to do this?
> > The page can not resubmit the action, so I had to do a redirect.
> >
> > Thanks
> >
> > Kal
> >
>
>

Re: Old error messages on a redirected page

Posted by Jay Balunas <ba...@gmail.com>.
Hello Kal,

I trying to understand you issue a little more.  You have something like a
login page that upon successful login redirects to another page?  If there
is an error it is displayed on the login page?  But if the use has invalid
login information entered, but clicks a command button to navigate to
another page the error still displays on the new page?

Is the error caused by a validator/converter, or with-in an action method?
Because this type of functionality is alot like a "cancel" button - you want
it to navigate, but not process validations.

This myfaces wiki page talks about one solution ( wiki
)<http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works>Using
the immediate attribute on command components.

-Jay

On 2/2/07, kal stevens <ka...@gmail.com> wrote:
>
> I have a page that is redirected in faces-config.xml file
>
> And my problem is that on this page, if the user gives an invalid input
> there is an error message.
> I would like it if when the user refreshes the page (or hits a back
> breadcrumb) if that error message was not displayed again.
>
> Is there a better way to do this?
> The page can not resubmit the action, so I had to do a redirect.
>
> Thanks
>
> Kal
>