This content has been marked as final.
Show 5 replies
-
1. Re: Seam, security and session
pmuir Nov 16, 2007 5:08 AM (in response to statelessbean)Use a page action on /home.xhtml to check login and issue a redirect using FacesManager if they are.
-
2. Re: Seam, security and session
statelessbean Nov 16, 2007 6:23 AM (in response to statelessbean)"pete.muir@jboss.org" wrote:
Use a page action on /home.xhtml to check login and issue a redirect using FacesManager if they are.
Can u explain, or target me?
page actions (u mean pages.xml) and u also write about FacesManager, but that 2 different ways.
I think better way maybe is in pages.xml but don't know how. Can U show me example? -
3. Re: Seam, security and session
pmuir Nov 16, 2007 6:27 AM (in response to statelessbean)<page view-id="/home.xhtml"> <action execute="#{controller.redirectIfLoggedIn}">
public void redirectIfLoggedIn() { // If logged in FacesManager.instance().redirect("/secure/home.xhtml");
-
4. Re: Seam, security and session
statelessbean Nov 16, 2007 8:44 AM (in response to statelessbean)I done as u said, but page doesn't work properly.
All app properties names are not visible and other stuff.
#{messages['login.portal']}
#{messages['login.login']}
Here is my code<page view-id="/home.xhtml"> <action execute="#{sessionAction.redirectIfLoggedIn}" /> </page>
public void redirectIfLoggedIn() {
try {
if (identity.isLoggedIn()) {
facesContext.getExternalContext().redirect("/mlm/pages/system.xhtml");
} else {
facesContext.getExternalContext().redirect("/mlm/home.xhtml");
}
} catch (Exception e) { }
} -
5. Re: Seam, security and session
pmuir Nov 16, 2007 9:07 AM (in response to statelessbean)No you haven't, I used FacesManager.