dev@javaserverfaces.java.net

Re: Invoking FacesNavigation from a Filter

From: Kito Mann <kito.mann_at_virtua.com>
Date: Mon, 2 Nov 2009 18:29:09 -0500

Hey Lincoln,

I wonder if this behavior has changed since JSF 1.x; I'm pretty sure that'd
work with 1.x.
---
Kito D. Mann | twitter: kito99 | Author, JSF in Action
Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and consulting
http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info | twitter:
jsfcentral
+1 203-404-4848 x3
JSF Summit Conference Dec 1st-4th in Orlando: http://www.jsfsummit.com
On Sat, Oct 31, 2009 at 11:51 PM, <lincolnbaxter_at_gmail.com> wrote:
> 2.0.1
> Sent from my Verizon Wireless BlackBerry
>
> -----Original Message-----
> From: "Manfred Riem" <mriem_at_manorrock.org>
> Date: Sat, 31 Oct 2009 20:34:29
> To: <dev_at_javaserverfaces.dev.java.net>
> Subject:  RE: Invoking FacesNavigation from a Filter
> Which version of JSF are you trying it on?
>
> Manfred
>
> -----Original Message-----
> From: Lincoln Baxter, III [mailto:lincolnbaxter_at_gmail.com]
> Sent: Saturday, October 31, 2009 3:39 PM
> To: dev_at_javaserverfaces.dev.java.net
> Subject: Re: Invoking FacesNavigation from a Filter
>
> Yeah, setViewRoot(), that doesn't do it :( I'm not sure why.
>
> On Sat, Oct 31, 2009 at 5:37 PM, Kito Mann <kito.mann_at_virtua.com> wrote:
> > Hello Lincoln,
> >
> > I don't think the viewId is set on the FacesContext until after
> > RESTORE_VIEW. It might work if you just manually call
> > facesContext.setViewId("/mypage.jsp").
> > ---
> > Kito D. Mann | twitter: kito99 | Author, JSF in Action
> > Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and
> consulting
> > http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info |
> twitter:
> > jsfcentral
> > +1 203-404-4848 x3
> >
> > JSF Summit Conference Dec 1st-4th in Orlando: http://www.jsfsummit.com
> >
> >
> >
> > On Sat, Oct 31, 2009 at 5:06 PM, Lincoln Baxter, III
> > <lincolnbaxter_at_gmail.com> wrote:
> >>
> >> It's the same problem with a PhaseListener. If I am attempting to
> >> invoke navigation before RESTORE_VIEW phase, NavigationHandler cannot
> >> find the outcome:
> >>
> >> "Unable to find matching navigation case from view ID '' for outcome
> >> '/faces/validation/target.jsf' "
> >>
> >> If I invoke navigation *after* RESTORE_VIEW phase, it resolves
> >> successfully.
> >>
> >> Perhaps this is just a bug? I feel like I should be able to invoke
> >> navigation, if not in a filter, at least in a PhaseListener before
> >> RESTORE_VIEW.
> >>
> >>
> >> --Lincoln
> >>
> >> On Sat, Oct 31, 2009 at 4:11 PM, Manfred Riem <mriem_at_manorrock.org>
> wrote:
> >> > Why would you want to use a Filter. Have you considered using
> >> > a PhaseListener instead?
> >> >
> >> > Manfred
> >> >
> >> > -----Original Message-----
> >> > From: Lincoln Baxter, III [mailto:lincolnbaxter_at_gmail.com]
> >> > Sent: Saturday, October 31, 2009 1:12 PM
> >> > To: dev_at_javaserverfaces.dev.java.net
> >> > Subject: Invoking FacesNavigation from a Filter
> >> >
> >> > Hi,
> >> >
> >> > I'm trying to invoke default FacesNavigation from a filter (Where I've
> >> > already instantiated a FacesContext,) but I can't seem to get it to
> >> > work unless the outcome was defined in a navigation case in
> >> > faces-config.xml.
> >> >
> >> > When the navigation case is a direct navigation (/faces/demo.jsf) or a
> >> > relative navigation string (eg: demo.jsf), no navigation occurs.
> >> >
> >> > I'm assuming this has to do with the fact that the view was not
> >> > restored and set into the context, but doing that manually with a
> >> > viewId of "" to prevent NullPointerException doesn't work either.
> >> >
> >> > Thoughts? How can I properly build the facesContext object model to
> >> > support navigation in a filter?
> >> >
> >> > Thanks,
> >> > Lincoln
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
> >> > For additional commands, e-mail:
> dev-help_at_javaserverfaces.dev.java.net
> >> >
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
> >> > For additional commands, e-mail:
> dev-help_at_javaserverfaces.dev.java.net
> >> >
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
> >> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>
>