1 2 Previous Next 18 Replies Latest reply on Dec 31, 2009 8:06 AM by sangaurav Go to original post
      • 15. Re: Seam 2.2.0.GA
        waltbarrow

        Clint, I started a new thread Seam 2.2.0.GA, Wicket -cannot start longrunning conversation

        • 16. Re: Seam 2.2.0.GA
          tiagoff

          Hello !!


          I do not know if is a BUG in this release (and previews).


          When you define in pages.xml the exception handler :



           <exception class="org.jboss.seam.security.NotLoggedInException">
              <redirect view-id="/pages/login.jspx">
                 <message severity="warn">Please log in first</message>
               </redirect>
           </exception>
          




          And in your template.xhtml use this to show all messages :


          <h:messages id="messages" globalOnly="true" styleClass="message"
            errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"
            rendered="#{showGlobalMessages != 'false'}" />
          



          And in your Pojo Class, you define a restrict access :



          @Name("CommentService")
          @Restrict("#{s:hasRole('USER')}")
          public class CommentService {
            ...
          }
          



          The seam is adding two warn messages on page : Please log in first, one come from Identity and the other one come from NotLoggedInException treatment (pages.xml), see bellow the Identity class bellow.


          Is it a bug  ?  Is there some trick for it ?
          I am not sure, but I saw something about you are removing all hard-coded set messages by Events.instance().raiseEvent(XXXX);



          org.jboss.seam.security.Identity


          public void checkPermission(Object target, String action)
             
           public void checkPermission(Object target, String action)
             {
                if (systemOp != null && Boolean.TRUE.equals(systemOp.get())) return;
                
                tryLogin();
                
                if ( !hasPermission(target, action) )
                {   
                   if ( !isLoggedIn() )
                   {
                      if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_LOGGED_IN);
                      throw new NotLoggedInException();            
                   }
                   else
                   {
                      if (Events.exists()) 
            1 ->        Events.instance().raiseEvent(EVENT_NOT_AUTHORIZED);
            2 ->        throw new AuthorizationException(String.format("Authorization check failed for permission[%s,%s]", target, action));
                   }
                }
             }  
               
          



          Thanks for help me !

          • 17. Re: Seam 2.2.0.GA
            tiagoff

            Hi friends,


            I marked the wrong lines :)


            public void checkPermission(Object target, String action)
               
             public void checkPermission(Object target, String action)
               {
                  if (systemOp != null && Boolean.TRUE.equals(systemOp.get())) return;
                  
                  tryLogin();
                  
                  if ( !hasPermission(target, action) )
                  {   
                     if ( !isLoggedIn() )
                     {
                        if (Events.exists())
            1 ->          Events.instance().raiseEvent(EVENT_NOT_LOGGED_IN);
            2 ->          throw new NotLoggedInException();            
                     }
                     else
                     {
                        if (Events.exists()) 
                          Events.instance().raiseEvent(EVENT_NOT_AUTHORIZED);
                          throw new AuthorizationException(String.format("Authorization check failed for permission[%s,%s]", target, action));
                     }
                  }
               }  
            

            • 18. Re: Seam 2.2.0.GA
              sangaurav
              I'm a newbie in Seam. I'm doing a POC on Seam-Spring Hybrid components. For that i'm trying to let seam load the context for Spring instead of using the listeners approach. For this i'm referencing the latest Seam Reference.

              The issue is when i register the component namespace http://jboss.com/products/seam/spring, prefixed as spring, in the component descriptor and define the <spring:context-loader/> component, the Eclipse shows two errors:

              1) cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'spring:context-loader'.
              2) Referenced file contains errors (http://jboss.com/products/seam/spring-2.2.xsd).  For more information, right click on the message in the Problems View and select "Show Details..."

              Below is the snippet of my component.xml file:

              <components xmlns="http://jboss.com/products/seam/components"
                      xmlns:core="http://jboss.com/products/seam/core"
                      xmlns:spring="http://jboss.com/products/seam/spring"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
                   http://jboss.com/products/seam/spring http://jboss.com/products/seam/spring-2.2.xsd
                   http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">

                      <spring:context-loader/>
                      <core:init debug="true" jndi-pattern="@jndiPattern@" />

                      <core:manager concurrent-request-timeout="500"
                              conversation-timeout="120000" conversation-id-parameter="cid"
                              parent-conversation-id-parameter="pid" />
              </components>

              If instead of http://jboss.com/products/seam/spring-2.2.xsd i use http://jboss.com/products/seam/spring-2.0.xsd then there are no such errors but following warning is displayed.

              1) XML schema version "2.0" does not match Seam runtime version "2.2".

              I have jboss-seam-ioc.jar in my /WEB-INF/lib folder. Please suggest the solution for this as it's kind of showstopper for me.

              Thanks,
              Gaurav Saini
              1 2 Previous Next