myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Robinson <andrew.rw.robin...@gmail.com>
Subject Re: Obtaining the url?
Date Mon, 05 Dec 2005 22:37:49 GMT
To be honest, I have not covered the part of the specification that
talks about bean initialization time. I would not be surprised if it
depends on the bean's scope. In general, I always feel that it is a
good decision to not put business code in a constructor. However,
since JSF may set managed properties, that brings up another question.
In this case, with a request-scoped variable, I would guess that the
bean would be created in the render response phase, but as I said, I
don't know (although I am curious).

Does anyone know?



On 12/5/05, Julián García <jgarcia@unionsoluciones.com.co> wrote:
> Is there any approach to access the url when the bean is initializing?
>
>
> Andrew Robinson wrote:
> > It is set right after the view is created. This differs based on if
> > there is queued action. If there is an action, the new view is created
> > during the application invoke phase. If the view is new (new request
> > or a redirect), then the view is created earlier in the lifecycle (I
> > can't remember for sure, but I think I remember it being during the
> > restore view phase).
> >
> > Once the view is created, getViewRoot() will not return null. Get view
> > ID on the view root should always return a value to my knowledge
> > (unless you have an odd view handler). The new view ID is always
> > available at the render response phase.
> >
> > On 12/5/05, Julián García <jgarcia@unionsoluciones.com.co> wrote:
> >
> >>Andrew Robinson wrote:
> >>
> >>>Are you looking for:
> >>>FacesContext.getCurrentInstance().getViewRoot().getViewId()?
> >>
> >>When is this id set....I am trying to access this method just after
> >>setting the values configured in my config xml, and it is always showing
> >>null.....
> >>
> >>Thanks-.
> >>
> >>
> >>>On 11/28/05, Julián García <jgarcia@unionsoluciones.com.co> wrote:
> >>>
> >>>
> >>>>How can I access the url that is being currently displayed for the user
> >>>>using the FacesContext? I need this to do a custom filter for
> >>>>authorization using acegi.....Any experiences to share with that?
> >>>>
> >>>>Thanks a lot.
> >>>>
> >>>>Julian
> >>>>
> >>>
> >>>
> >>
> >
>
>

Mime
View raw message