Is that means all JSF request are post method, and if user click
refresh button or F5 a get method is sent?

On 4/29/06, Travis Reeder <[EMAIL PROTECTED]> wrote:
I usually try to use h:outputLink's wherever possible instead of
commandLink's so it will use GETs and you won't have to worry as much about
this refresh problem.  I know the JSF purists might say to use commands
everywhere, but in reality, you're app will be much more usable if you use
outputLink.

Rule of thumb: commandLink or commandButton when you want an action to
happen (aka, posting a form), and outputLink when it's just a navigation
link.

Travis


On 4/28/06, Andrew Robinson <[EMAIL PROTECTED]> wrote:
> Could you create a phase listener to check if the request is a POST or
> GET, and if a GET, create a new view root? With server-side state
> saving, views seem to be reused if the URL doesn't change. I haven't
> looked at the code, but I see the same behavior (the same view tree is
> used).
>
> Another alternative is to use client side state, that way the browser
> will not post the component state back on refresh.
>
> On 4/28/06, Anthony Hong < [EMAIL PROTECTED]> wrote:
> > You mean as javascript you wrote can prevent form submit?
> > I don't want to prevent refresh, but I just want refresh in request a
> > new page same as jsf page first requested, its lifecycle create a new
> > jsf view component tree and render response.
> >
> >
> > On 4/28/06, aliko <[EMAIL PROTECTED]> wrote:
> > >
> > > You can trap F5 key and call form.submit with a little javascript. But
that
> > > does not help when user clicks the refresh button.
> > >
> > > <script>
> > >
> > > function ui_onkeydown_handler() {
> > >        switch ( event.keyCode)    {
> > >                case 116 : // F5
> > >                        event.keyCode = 0;
> > >                        event.returnValue = false;
> > >                        document.forms ['form1'].submit();
> > >        }
> > > }
> > >
> > > document.attachEvent("onkeydown", ui_onkeydown_handler);
> > > </script>
> > >
> > >
> > > --
> > > View this message in context:
http://www.nabble.com/Issues-with-refresh-page-in-JSF-t1523452.html#a4140628
> > > Sent from the MyFaces - Users forum at Nabble.com.
> > >
> > >
> >
> >
> > --
> >
> > Anthony Hong
> >
>




--

Anthony Hong

Reply via email to