I try to  use the built-in security handling to redirect user to the page she 
originally requested after the login.

I works fine when I'm using login-required="true" in pages.xml but the problem 
is when I'm using @Restrict("#{identity.loggedIn}") in the class. When the 
annotations is used, the login page is shown but after login the page is 
reloaded (instead of the originally requested). And on the JBoss Console I can 
see an Exception: javax.faces.el.EvaluationException: Exception while invoking 
expression #{commandeService.commander} ...........  Caused by: 
org.jboss.seam.security.NotLoggedInException

I'm doing something wrong ?

here is my files :

pages.xml :
 <pages no-conversation-view-id="/home.xhtml"
                 login-view-id="/login.xhtml">
         <page view-id="*">
                ...
                <navigation from-action="#{commandeService.commander(panier)}">
                        <redirect view-id="/commande.xhtml">
                
                        ...
         
         
        <page view-id="/commande.xhtml" login-required="true">
        ...
        
        <redirect view-id="/login.xhtml">
            #{messages.NotLoggedIn}
        
    
    



components.xml:
...

  

   

  

...

Java class, session bean with restricted method/class:

@Stateful
@Scope(CONVERSATION)
@Name("commandeService")

@Restrict("#{identity.loggedIn}")
public class CommandeServiceBean implements CommandeService{

        @In(required=false)
        private User user;
        ...
        @PersistenceContext
        private EntityManager em;

        @Begin(join=true)
        public void commander(Panier panier) throws PoidsMaxException, 
NotLoggedInException {
                ...
        }
}

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4083871#4083871

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4083871
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to