Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
21. Feb 2008, 09:22 CET | Link

I have a login page. When the login succeds a new conversation is initiated and the user is redirected to the main program page. This works fine.

Is there a way to directly create a conversation and redirect the user to the main page if 1. the user already loggen in and 2. has an active Session and 3. tries to open the login page?

I currently use a custom authorisation function.

Thank you in advance.

Uwe Müller

6 Replies:
21. Feb 2008, 09:32 CET | Link

how about an if-navigation rule on identity.loggedIn that redirects you?

 

If a man speaks in the forest and there is no woman around to hear him, is he still wrong?

21. Feb 2008, 10:55 CET | Link

I already have an if navigation rule in my pages.xml file But this only seems to be evaluated after the login button is pressed.

    <page view-id="/home.xhtml">
        <navigation>
            <rule if="#{userSession.loggedIn}">
                <redirect view-id="/workspace.xhtml"/>
            </rule>
        </navigation>
    </page>

A page action itself may be executed at start, but how is possible to initiate a conversation, save some Data in this conversation and redirect to workspace.xhtml if the session is already open.

21. Feb 2008, 13:12 CET | Link

Use a page action, the evaluated before you render the page.

 

Read about how to report a bug.

11. Mar 2008, 13:29 CET | Link

I tried a solution with a page action. But how can a page action create a new conversation only if the user already has a session and then perform a redirect?

My current solution is to include javascript that will click the login button on the first page if the user already logged in.

21. Mar 2008, 09:28 CET | Link

I was also wondering this myself. did you solve this. I actually tried to have my action throw an exception that should have been caught and redirected by my exception handler. Originally my login page worked and rendered fine...once I added the code to throw exception in redirect, the login page no longer works for someone not logged in. when it tries to render, I get @In attribute requires non-null value: login.user which is really funny because the action has nothing to do with the login component...ie. no changes to login component are made. I just remove the action and it works again, put back the action and the navigation component fails.

26. Mar 2008, 10:27 CET | Link

What version of Seam? This sounds like a bug in exception handling.

 

Read about how to report a bug.