This content has been marked as final.
Show 3 replies
-
1. Re: actionMethod parameter with xhtml suffix
toddpi314 Nov 8, 2010 11:25 AM (in response to erbora00.bora.erbas.gmail.com)Hey Bora.
Check out the layout folder in your web/view directory.
Here, you will find a menu.xhtml which is included on the default layout template (f:view).
You should see something like :
<s:link id="menuLogoutId" view="/home.xhtml" action="#{identity.logout}" value="Logout" rendered="#{identity.loggedIn}" propagation="none"/>
Here, you can see that there is a 'redirecting' viewId, as well as an action method which serves as component binding on post-back.
I believe the 'view' property on this tag is what you want to change for the logout redirect to work against home.htm.
Alternatively, you can also handle this routing in the pages.xml by something like this:
<page view-id="/login.xhtml">
<action execute="#{authenticator.logoutAndRedirectToLoginPage}" if="#{identity.loggedIn}"/>
</page>
Where, there exists a backing stateless component with method
public void logoutAndRedirectToLoginPage() {
identity.logout();
Redirect r = new Redirect();
r.setViewId("/home.htm");
r.setConversationPropagationEnabled(false);
r.execute();
}
This will allow you to redirect a logged in user to the login page, then automatically log them out based on the login url.
You can see that the Redirect type has very similar parameters to the s:Link attributes.
Not the best use-case for all, but a good example of how you can route activity in the pages.xml
Hope that helps!
Todd -
2. Re: actionMethod parameter with xhtml suffix
erbora00.bora.erbas.gmail.com Feb 26, 2011 4:12 AM (in response to erbora00.bora.erbas.gmail.com)I am not sure how I missed this reply but thanks!
It's been a while though.. -
3. Re: actionMethod parameter with xhtml suffix
erbora00.bora.erbas.gmail.com Feb 27, 2011 3:55 AM (in response to erbora00.bora.erbas.gmail.com)BTW, I have edited the menu.xhtml and it's still the same.
So that one doesn't work.
I couldn't try the others.