2 Replies Latest reply on Jun 4, 2008 6:15 PM by nuno.caneco

    message severity="ERROR" doesn't work

    rhomber

      Hey,


        This has been driving me nuts, so I hope someone here can help. I have implemented a special exception that is thrown when the back end is experiencing problems. I have added a handler for the exception but the messages aren't being displayed properly. If I remove the severity setting it works, but if I leave it as ERROR it doesn't show up at all. I have tried various combinations and I am not sure what is causing the issue.


      pages.xml:


          <exception class="com.utiba.wt.ugaml.exception.UGAMLSystemErrorException">
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Error: #{messages['com.utiba.wt.ugaml.exception.UGAMLSystemErrorException']}</message>
              </redirect>
          </exception>





      error.xhtml:



      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                      xmlns:s="http://jboss.com/products/seam/taglib"
                      xmlns:ui="http://java.sun.com/jsf/facelets"
                      xmlns:f="http://java.sun.com/jsf/core"
                      xmlns:h="http://java.sun.com/jsf/html"
                      xmlns:rich="http://richfaces.org/rich"
                      template="/WEB-INF/templates/layout/template.xhtml">
      
          <ui:define name="body">
      
              <rich:panel>
                  <f:facet name="header">Error(s)</f:facet>
      
                  <h:messages globalOnly="true"/>
      
              </rich:panel>
      
          </ui:define>
      </ui:composition>




      In the above example I have tried with globalOnly enabled and disabled. Neither worked. I should point out the exception is being thrown in the middle of a jdPL page flow, will this have any impact?


      Any ideas what I may be doing wrong?


      Cheers,


      David

        • 1. Re: message severity="ERROR" doesn't work
          rhomber

          Any ideas people? I will try and upgrade to the new version of Seam today and see if that helps.. but if anyone has an idea please let me know :)


          David

          • 2. Re: message severity="ERROR" doesn't work
            nuno.caneco

            Hi!


            I'm having the same problem with my app.


            According to the definition in my pages.xml file:


                <exception class="org.jboss.seam.security.AuthorizationException">
                     <end-conversation/>
                    <redirect view-id="/error.xhtml">
                        <message severity="WARN">Authorization exception</message>
                    </redirect>
                </exception>



            I should be redirected to /error.xhtml and get that message with WARN severity.


            But what happens is that I get redirected to /error.xhtml page, but the message does not appear.


            Also, I get this message on my log:


            2008-06-04 17:01:12,043 ERROR [org.jboss.seam.jsf.SeamPhaseListener] uncaught exception
            org.jboss.seam.security.AuthorizationException: Authorization check failed for expression [#{sdsAuth.canManageSystemMaintenance}]
            



            Does this happens to you too?
            Have you been able to overcome this issue?