14 Replies Latest reply on Apr 29, 2008 12:31 PM by mnmvpi97

    Richfaces 3.2.0 output immediately after login

    mnmvpi97

      I just upgraded to Richfaces 3.2.0 from 3.1.4. I'm running JBoss 4.2.1GA (default configuration). My application deploys without error, and when I launch the application, my login page appears just fine. However, when I log in to the application, instead of being directed to my default page, I am directed to the following URL:

      http://localhost:8080/{contextroot}a4j_3_2_0-SNAPSHOTorg/richfaces/skin-ext-classes.xcss/DATB/eAFrjvzqAgAFSQIW.jsf

      And the following is displayed on the page:

      .rich-container input,.rich-input,.rich-container select,.rich-select,.rich-container textarea,.rich-textarea,.rich-container button,.rich-button,.rich-container keygen,.rich-keygen,.rich-container isindex,.rich-isindex,.rich-container legend,.rich-legend,.rich-container a,.rich-link,.rich-container fieldset,.rich-fieldset,.rich-field,.rich-field-edit,.rich-field-error,.rich-button,.rich-button-disabled,.rich-button-over,.rich-button-press{font-size:10px;font-family:Arial,Helvetica,sans-serif;color:#000;}.rich-container fieldset,.rich-fieldset{border-width:1px;border-style:solid;padding:10px;}.rich-container hr,.rich-hr{border-width:1px;border-style:solid;}.rich-container legend,.rich-legend{font-weight:bold;}.rich-container form,.rich-form{padding:0;margin:0;}.rich-container fieldset,.rich-fieldset{border-color:#800000;}.rich-container hr,.rich-hr{border-color:#800000;}.rich-container a,.rich-link{color:#800000;}.rich-container a:hover,.rich-link:hover{color:#A00;}.rich-container a:visited,.rich-link:visited{color:#A00;}.rich-field,.rich-field-edit,.rich-field-error{border-width:1px;border-style:inset;border-color:#800000;}.rich-field{background-color:#fff;background-image:url(/AAP/a4j_3_2_0-SNAPSHOTorg.richfaces.renderkit.html.images.ButtonBackgroundImage/DATB/eAFjYGAIDQ1lYGDgAgAGDgEK.jsf);background-repeat:no-repeat;background-position:1px 1px;}.rich-field-edit{background-color:#FEFFDA;}.rich-field-error{background-color:#F00;background-image:url(/AAP/a4j_3_2_0-SNAPSHOTorg.richfaces.renderkit.html.images.InputErrorIcon/DATB/eAF79uw.AAWAAsw_.jsf);background-repeat:no-repeat;background-position:center left;padding-left:7px;}.rich-button,.rich-button-disabled,.rich-button-over,.rich-button-press{border-width:1px;border-style:solid;border-color:#800000;background-color:#CCC;padding:2px 10px 2px 10px;text-align:center;cursor:pointer;background-repeat:repeat-x;background-position:top left;}.rich-button{background-image:url(/AAP/a4j_3_2_0-SNAPSHOTorg.richfaces.renderkit.html.images.StandardButtonBgImage/DATB/eAFjYGA4c-YMAwODIAAOcwJ2.jsf);}.rich-button-disabled{background-image:url(/AAP/a4j_3_2_0-SNAPSHOTorg.richfaces.renderkit.html.images.StandardButtonBgImage/DATB/eAFjYGA4c-YMAwODIAAOcwJ2.jsf);}.rich-button-over{background-image:url(/AAP/a4j_3_2_0-SNAPSHOTorg.richfaces.renderkit.html.images.StandardButtonBgImage/DATB/eAFjYGA4c-YMAwODIAAOcwJ2.jsf);}.rich-button-press{background-image:url(/AAP/a4j_3_2_0-SNAPSHOTorg.richfaces.renderkit.html.images.StandardButtonPressedBgImage/DATB/eAE7c-YMAxgIAgAVnwJ2.jsf);background-position:bottom left;}.rich-box-border-color-control-select{border-color:#E79A00;}.rich-box-border-color-subborder{border-color:#fff;}.rich-box-border-color-header{border-color:#555;}.rich-box-border-color-general{border-color:#FFF;}.rich-box-border-color-additional{border-color:#000;}.rich-box-border-color-panel{border-color:#800000;}.rich-box-border-color-tip{border-color:#800000;}.rich-box-border-color-table{border-color:#C0C0C0;}.rich-box-border-control-select,.rich-box-border-subborder,.rich-box-border-header,.rich-box-border-general,.rich-box-border-additional,.rich-box-border-panel,.rich-box-border-tip,.rich-box-border-table{border-style:solid;border-width:1px;}.rich-box-border-control-select{border-color:#E79A00;}.rich-box-border-subborder{border-color:#fff;}.rich-box-border-header{border-color:#555;}.rich-box-border-general{border-color:#FFF;}.rich-box-border-additional{border-color:#000;}.rich-box-border-panel{border-color:#800000;}.rich-box-border-tip{border-color:#800000;}.rich-box-border-table{border-color:#C0C0C0;}.rich-box-bgcolor-header{background-color:#555;}.rich-box-bgcolor-general{background-color:#FFF;}.rich-box-bgcolor-additional{background-color:#000;}.rich-box-bgcolor-tab{background-color:#000;}.rich-box-bgcolor-trim{background-color:#CCC;}.rich-box-bgcolor-tip{background-color:#FAE6B0;}.rich-box-bgcolor-table{background-color:#FFF;}.rich-box-bgcolor-table-footer{background-color:#CCC;}.rich-box-bgcolor-table-subfooter{background-color:#f1f1f1;}.rich-box-bgcolor-editor{background-color:#F1F
      

      My configuration hasn't changed since 3.1.4, but perhaps there's something new that needs to be added??

      Here's a snippet of my web.xml related to the RichFaces configuration (it's listed at the bottom of the file, if that makes a difference):

      <!-- RichFaces -->
       <context-param>
       <param-name>org.richfaces.SKIN</param-name>
       <param-value>blueSky</param-value>
       </context-param>
       <context-param>
       <param-name>org.richfaces.LoadStyleStrategy</param-name>
       <param-value>ALL</param-value>
       </context-param>
       <filter>
       <display-name>RichFaces Filter</display-name>
       <filter-name>richfaces</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>richfaces</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       <dispatcher>REQUEST</dispatcher>
       <dispatcher>FORWARD</dispatcher>
       <dispatcher>INCLUDE</dispatcher>
       </filter-mapping>
      


        • 1. Re: Richfaces 3.2.0 output immediately after login

          Most likely, setting org.richfaces.LoadStyleStrategy to DEFAULT should help.

          • 2. Re: Richfaces 3.2.0 output immediately after login

            Jira issue has been created: http://jira.jboss.com/jira/browse/RF-2985

            • 3. Re: Richfaces 3.2.0 output immediately after login
              mnmvpi97

              org.richfaces.LoadStyleStrategy work around did not work. :(

              • 4. Re: Richfaces 3.2.0 output immediately after login
                nbelaevski

                Hello,

                I've just created Seam application from scratch, updated it to RichFaces 3.2.0.GA, launched and then logged in successfully. Could you please provide demo war? You can attach it to JIRA issue. Thank you in advance!

                P.S. I've tried Seam 2.0.0 and 2.0.1

                • 5. Re: Richfaces 3.2.0 output immediately after login
                  mnmvpi97

                  We're not using Seam at this point. That wouldn't be a problem would it?

                  • 6. Re: Richfaces 3.2.0 output immediately after login
                    mnmvpi97

                    My issue wouldn't be related to this issue, would it?

                    http://www.seamframework.org/Community/RedirectedToNonexistentDebugcss

                    We are using some Tomahawk components...

                    • 7. Re: Richfaces 3.2.0 output immediately after login
                      nbelaevski

                       

                      "mnmvpi97" wrote:
                      We're not using Seam at this point. That wouldn't be a problem would it?


                      There are some issues with styles loading caused by Seam. Please see: http://jira.jboss.com/jira/browse/RF-2316 for more info.

                      • 8. Re: Richfaces 3.2.0 output immediately after login
                        nbelaevski

                         

                        "mnmvpi97" wrote:
                        My issue wouldn't be related to this issue, would it?

                        http://www.seamframework.org/Community/RedirectedToNonexistentDebugcss

                        We are using some Tomahawk components...


                        I think it can be this issue. Could you please attach runnable WAR file to the JIRA issue so that I can reproduce the problem? Thank you in advance!

                        • 9. Re: Richfaces 3.2.0 output immediately after login
                          mnmvpi97

                          Ok, I believe I've tracked the problem down to filter mapping in web.xml. If I change this:

                           <filter-mapping>
                           <filter-name>richfaces</filter-name>
                           <servlet-name>Faces Servlet</servlet-name>
                           <dispatcher>REQUEST</dispatcher>
                           <dispatcher>FORWARD</dispatcher>
                           <dispatcher>INCLUDE</dispatcher>
                           </filter-mapping>


                          To this:

                           <filter-mapping>
                           <filter-name>richfaces</filter-name>
                           <servlet-name>Faces Servlet</servlet-name>
                           <dispatcher>REQUEST</dispatcher>
                           <dispatcher>INCLUDE</dispatcher>
                           </filter-mapping>


                          Everything works as expected. The question is, why?

                          • 10. Re: Richfaces 3.2.0 output immediately after login
                            nbelaevski

                            I've added richfaces jars and filter to the tomahawk demo application and it's working fine for me.

                            Could you please provide some more details on the problem:

                            1. Complete web.xml source
                            2. tomahawk and JSF libraries version
                            3. Page source

                            ?

                            Thank you in advance!

                            • 11. Re: Richfaces 3.2.0 output immediately after login
                              mnmvpi97

                              Tomahawk 1.1.6
                              Tomahawk Facelets Taglib 1.1.6
                              JSF-Facelets 1.1.12

                              web.xml:

                              <?xml version="1.0" encoding="UTF-8"?>
                              <web-app xmlns="http://java.sun.com/xml/ns/javaee"
                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
                               xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
                               <!-- Facelets -->
                               <context-param>
                               <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                               <param-value>.xhtml</param-value>
                               </context-param>
                               <context-param>
                               <param-name>facelets.DEVELOPMENT</param-name>
                               <param-value>true</param-value>
                               </context-param>
                               <context-param>
                               <param-name>facelets.REFRESH_PERIOD</param-name>
                               <param-value>-1</param-value>
                               </context-param>
                               <context-param>
                               <param-name>facelets.LIBRARIES</param-name>
                               <param-value>/WEB-INF/tomahawk.taglib.xml</param-value>
                               </context-param>
                              
                               <filter>
                               <filter-name>MyFacesExtensionsFilter</filter-name>
                               <filter-class>
                               org.apache.myfaces.webapp.filter.ExtensionsFilter
                               </filter-class>
                               <init-param>
                               <param-name>maxFileSize</param-name>
                               <param-value>20m</param-value>
                               <!-- description>
                               Set the size limit for uploaded files. Format: 10 - 10
                               bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
                               </description -->
                               </init-param>
                               </filter>
                              
                               <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
                               <filter-mapping>
                               <filter-name>MyFacesExtensionsFilter</filter-name>
                               <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
                               <servlet-name>Faces Servlet</servlet-name>
                               </filter-mapping>
                              
                               <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
                               <filter-mapping>
                               <filter-name>MyFacesExtensionsFilter</filter-name>
                               <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
                               </filter-mapping>
                              
                               <context-param>
                               <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                               <param-value>client</param-value>
                               </context-param>
                               <context-param>
                               <param-name>javax.faces.CONFIG_FILES</param-name>
                               <param-value>/WEB-INF/faces-config.xml</param-value>
                               </context-param>
                              
                               <servlet>
                               <servlet-name>Faces Servlet</servlet-name>
                               <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                               <load-on-startup>1</load-on-startup>
                               <run-as>
                               <role-name>guest</role-name>
                               </run-as>
                               </servlet>
                               <context-param>
                               <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                               <param-value>com.sun.facelets.FaceletViewHandler</param-value>
                               </context-param>
                              
                               <servlet-mapping>
                               <servlet-name>Faces Servlet</servlet-name>
                               <url-pattern>*.jsf</url-pattern>
                               </servlet-mapping>
                              
                               <security-constraint>
                               <web-resource-collection>
                               <web-resource-name>APPWebShop</web-resource-name>
                               <description>
                               Allow users to access pictures and css.
                               </description>
                               <url-pattern>/images/*</url-pattern>
                               </web-resource-collection>
                               </security-constraint>
                              
                               <security-constraint>
                               <web-resource-collection>
                               <web-resource-name>APPWebShop</web-resource-name>
                               <description>Require users to authenticate.</description>
                               <url-pattern>*.jsf</url-pattern>
                               <url-pattern>/pages/*</url-pattern>
                               <url-pattern>/includes/*</url-pattern>
                               </web-resource-collection>
                               <auth-constraint>
                               <role-name>ROOT</role-name>
                               <role-name>ADMIN</role-name>
                               <role-name>USER</role-name>
                               </auth-constraint>
                               </security-constraint>
                              
                               <security-role>
                               <description>Root</description>
                               <role-name>ROOT</role-name>
                               </security-role>
                               <security-role>
                               <description>Administrator</description>
                               <role-name>ADMIN</role-name>
                               </security-role>
                               <security-role>
                               <description>User</description>
                               <role-name>USER</role-name>
                               </security-role>
                               <security-role>
                               <description>Guest User (unsecured)</description>
                               <role-name>guest</role-name>
                               </security-role>
                              
                               <login-config>
                               <auth-method>FORM</auth-method>
                               <realm-name>APPJaasDbRealm</realm-name>
                               <form-login-config>
                               <form-login-page>/login/login.jsf</form-login-page>
                               <form-error-page>/login/login_fail.jsf</form-error-page>
                               </form-login-config>
                               </login-config>
                              
                               <session-config>
                               <session-timeout>30</session-timeout>
                               </session-config>
                              
                               <welcome-file-list>
                               <welcome-file>/pages/welcome.jsf</welcome-file>
                               </welcome-file-list>
                              
                               <error-page>
                               <error-code>404</error-code>
                               <location>/http/404.html</location>
                               </error-page>
                              
                               <error-page>
                               <error-code>500</error-code>
                               <location>/http/500.html</location>
                               </error-page>
                              
                               <!-- RichFaces -->
                               <context-param>
                               <param-name>org.richfaces.SKIN</param-name>
                               <param-value>APPWebshopSkin</param-value>
                               </context-param>
                               <context-param>
                               <param-name>org.richfaces.LoadStyleStrategy</param-name>
                               <param-value>DEFAULT</param-value>
                               </context-param>
                               <filter>
                               <display-name>RichFaces Filter</display-name>
                               <filter-name>richfaces</filter-name>
                               <filter-class>org.ajax4jsf.Filter</filter-class>
                               </filter>
                               <filter-mapping>
                               <filter-name>richfaces</filter-name>
                               <servlet-name>Faces Servlet</servlet-name>
                               <dispatcher>REQUEST</dispatcher>
                               <dispatcher>INCLUDE</dispatcher>
                               <dispatcher>FORWARD</dispatcher>
                               </filter-mapping>
                              </web-app>
                              
                              


                              Login page (w/ template):

                              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                              <html xmlns="http://www.w3.org/1999/xhtml"
                               xmlns:ui="http://java.sun.com/jsf/facelets"
                               xmlns:h="http://java.sun.com/jsf/html"
                               xmlns:f="http://java.sun.com/jsf/core"
                               xmlns:rich="http://richfaces.org/rich"
                               xmlns:a4j="http://richfaces.org/a4j"
                               xmlns:t="http://myfaces.apache.org/tomahawk">
                               <f:loadBundle basename="com.company.web.messages" var="msgs"/>
                               <head>
                               <meta http-equiv="Content-Type"
                               content="text/html; charset=iso-8859-1" />
                               <title><h:outputText value="#{msgs.application} - Login"/></title>
                               <t:stylesheet path="/styles/master.css" />
                               </head>
                               <body>
                               <div id="frame">
                               <div id="contentheader" style="border-top: 3px solid black;">
                               </div>
                               <div id="contentsingle" style="top: -100px; height: 450px">
                               <div id="login">
                               <ui:insert name="content" />
                               </div>
                               <div id="contentfooter">
                               <ui:include src="/includes/footer.xhtml"/>
                               </div>
                               </div>
                               </body>
                              </html>
                              

                              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                              <html xmlns="http://www.w3.org/1999/xhtml"
                               xmlns:ui="http://java.sun.com/jsf/facelets"
                               xmlns:h="http://java.sun.com/jsf/html"
                               xmlns:f="http://java.sun.com/jsf/core"
                               xmlns:rich="http://richfaces.org/rich"
                               xmlns:a4j="http://richfaces.org/a4j"
                               xmlns:t="http://myfaces.apache.org/tomahawk">
                               <ui:composition template="/layouts/login_layout.xhtml">
                               <ui:define name="content">
                               <form id="loginForm" method="post" action="j_security_check">
                               <h:panelGrid columns="2" style="vertical-align: bottom">
                               <h:panelGrid id="loginPanelGrid" columns="2" style="float: right">
                               <h:inputText id="j_username" size="20" maxlength="50" style="float: left; vertical-align: bottom;"/>
                               <h:inputSecret id="j_password" size="10" maxlength="50" style="float: left; vertical-align: bottom;"/>
                               </h:panelGrid>
                              
                               <h:commandButton id="submit" value="Login" styleClass="button" style="vertical-align: bottom"/>
                               </h:panelGrid>
                               </form>
                               </ui:define>
                               </ui:composition>
                              </html>
                              


                              • 12. Re: Richfaces 3.2.0 output immediately after login
                                nbelaevski

                                Great, we'll check! Thank you very much!

                                • 13. Re: Richfaces 3.2.0 output immediately after login
                                  nbelaevski

                                  Hello,

                                  Please see my comment in JIRA

                                  • 14. Re: Richfaces 3.2.0 output immediately after login
                                    mnmvpi97

                                    That seems to have worked!! Thanks for sticking with me.

                                    Did I miss that configuration in the documentation? I don't seem to remember coming across it anywhere. If it's not documented, should there be a JIRA request opened to document the issue? I'm sure someone else has struggled with this before...