[solved] Combination of complex URL and customViewResolver Creates issues

Splash Forums PrettyFaces Users [solved] Combination of complex URL and customViewResolver Creates issues

This topic contains 7 replies, has 2 voices, and was last updated by  void_void 7 years ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #17739

    void_void
    Participant

    Hello,

    in my case scenario is :

    i want to parse URL and need to fetch some data from it into sessino

    like

    /portal/jigar/login/

    then i will take jigar as my CompanyName in session.

    and accordingly upon successfull login using spring security i will show user the url pattern like

    /portal/jigar/home/

    so i have pattern in my pretty-config as

    /portal/.*/login

    and now the actual problem starts .

    upon login a jsf action will get called.

    now i want if jigar got logged in then it should be redirected to

    /portal/jigar/login

    if jigar1 then

    /portal/jigar1/login

    more generally

    if a then

    /portal/a/login/

    how to do this ?

    if i use default navigation handler , and i return like “/portal/jigar/login/” then

    it searches for “/home/jigar/login/.jsf”

    and if i use pretty navigation handler then

    it gets some thing like

    /portal/.*/login/

    as url ..

    which is not desired

    hope i have clearly explained this.

    #19899

    void_void
    Participant

    solved by maintaining a session Bean

    #19900

    Your pattern should probably look like this:

    <pattern value="/portal/#{companyBean.value}/login/" />

    PrettyFaces will then be able to put the value directly into the bean, and also rebuild the URL from the bean when you try to navigate using:

    return "pretty:login";

    From your JSF login action method.

    #19901

    void_void
    Participant

    “PrettyFaces will then be able to put the value directly into the bean” didnt get this

    #19902

    Take a look at bullet #1 in the pretty-config docs: http://ocpsoft.com/prettyfaces/docs/#prettyconfig

    #19903

    void_void
    Participant

    ok Thanks Lincon

    #19904

    No problem. Did that explanation make sense?

    #19905

    void_void
    Participant

    yes i had read it actually before.

    but i was confused about your statement :”PrettyFaces will then be able to put the value directly into the bean”

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Comments are closed.