session is invalid within specific url patterns

Splash Forums PrettyFaces Users session is invalid within specific url patterns

This topic contains 5 replies, has 2 voices, and was last updated by  Christian Kaltepoth 1 year, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26983

    alexander
    Participant

    Pls excuse my english. It is not the best, so far. 🙂

    I am developing an Enterprise Application Project with
    JSF
    PrettyFaces
    PrimeFaces
    CDI

    and so on..

    A CDI-Bean annotated with @SessionScoped (javax.enterprise.context.SessionScoped) holds the current logged in user. This works fine.

    URL-Rewriting works just fine, too. In most of the cases like:

    	<url-mapping id="index">
    		<pattern value="/" />
    		<view-id value="/protected/index.xhtml" />
    	</url-mapping>
    

    or

            <url-mapping id="profilesd">
    		<pattern value="/blal/bl" />
    		<view-id value="/protected/BenutzerProfil.xhtml" />
    	</url-mapping>
    

    But in some cases, it does not work correctly.

    `

           <url-mapping id="profrgbrtile">
    		<pattern value="/benutzer/profil" />
    		<view-id value="/protected/BenutzerProfil.xhtml" />
    	</url-mapping>
    

    This does not work. The session-scoped-bean is an other as after the login.

    Workflow:

    open webapp with localhost:8080
    login with localhost:8080/anmeldung -> bean id like 1200

    open working url -> fine
    open not working url -> the session bean is currently 2502

    and so far, the current user cannot be resolved.

    Any ideas? I tried so many pattern, but I can not find the pattern of working or not working examples.

    Please feel free to ask as many question as you want!

    • This topic was modified 1 year, 5 months ago by  alexander.
    #26985

    I see no reason why this could be caused by PrettyFaces. You are using cookies for your sessions, right? I guess this also happens if you don’t use PrettyFaces for the problematic page, right?

    #26986

    alexander
    Participant

    Me neither. I removed PrettyFaces completly out of my project.
    With:

    http://localhost:8080/protected/index.xhtml
    and ALL OTHER .xhtml-pages it works totally fine.

    I am ‘only’ using @SessionScoped for the bean and this bean holds the user as object within the whole session.

    #26987

    I’ve no idea why only this page should be affected. The mapping looks exactly like others…

    #26988

    alexander
    Participant

    Me neither. Anyway. I got it solved. You wanna hear the solution? I have no clue!
    I started a new project from scratch. Just one login page with a cdi sessionscoped bean.
    It was working.

    I guess, it was not PrettyFaces at all. But really no clue!

    Thanks anyway Christian!

    Greetings from NRW (near Lemgo/Bielefeld) to lovely Duisburg! =)

    #26989

    Awesome. 🙂

    Pretty small world, isn’t it? 😉

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

You must be logged in to reply to this topic.

Comments are closed.