0 Replies Latest reply on Mar 25, 2010 1:02 PM by Janakiram Narla

    Richfaces Skin is not applying when using pretty URLs( urlrewritefilter configurations)

    Janakiram Narla Newbie
      Hi,

      I am using urlrewritefilter for actual url masking.when i am reguesting for web page using prety urls(http://localhost:8080/home) taking me to the actual web page,but web page is displaying without applying the richfaces skin.Below is my web.xml file.


      web.xml
      ...........



      <!-- RichFaces -->

           <context-param>
                <param-name>org.richfaces.SKIN</param-name>
                <param-value>#{skinBean.skin}</param-value>
           </context-param>

      <!-- filter configurations-->
      <filter>
                <filter-name>UrlRewriteFilter</filter-name>
                <filter-class>
                     org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
                </filter-class>
                     <init-param>
                     <param-name>logLevel</param-name>
                     <param-value>DEBUG</param-value>
                     </init-param>
           </filter>

           <filter-mapping>
                <filter-name>UrlRewriteFilter</filter-name>
                <url-pattern>/*</url-pattern>
           </filter-mapping>


      <servlet>
                <servlet-name>Faces Servlet</servlet-name>
                <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                <load-on-startup>1</load-on-startup>
           </servlet>

           <servlet-mapping>
                <servlet-name>Faces Servlet</servlet-name>
                <url-pattern>*.seam</url-pattern>
           </servlet-mapping>

      and
      urlrewritefilter.xml
      ....................

      <?xml version="1.0" encoding="utf-8"?>
      <!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN" "http://tuckey.org/res/dtds/urlrewrite3.0.dtd">

      <urlrewrite >

      <rule>
                <from>^/([a-zA-Z]+)$</from>
                <to last="true">/$1.seam</to>
           </rule>

      <rule>
                <from>^/entry/([a-zA-Z]+)$</from>
                <to last="true">/$1.seam</to>
           </rule>


      <outbound-rule>
                <from>^/([a-zA-Z]+)\.seam$</from>
                <to>/entry/$1</to>
           </outbound-rule>


      </urlrewrite>


      when i request using the URL http://localhost:8080/home.seam then web page is displaying with applied skin. below is the Log file for this request.

      ..
      ......
      ...
      17:24:07,871 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing outbound url for /resetPassword?conversationPropagation=none&cid=5
      17:24:07,881 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing outbound url for /a4j/s/3_3_2.GA/org/richfaces/skin.xcss/DATB/eAFbkFjeHLp8hjQAEZwDqw__
      17:24:07,881 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Outbound Rule 0 run called with /a4j/s/3_3_2.GA/org/richfaces/skin.xcss/DATB/eAFbkFjeHLp8hjQAEZwDqw__
      17:24:07,881 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing outbound url for /a4j/s/3_3_2.GA/org/richfaces/skin.xcss/DATB/eAFbkFjeHLp8hjQAEZwDqw__
      17:24:07,881 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing outbound url for /a4j/g/3_3_2.GAjquery.js
      17:24:07,881 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Outbound Rule 0 run called with /a4j/g/3_3_2.GAjquery.js
      17:24:07,881 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing outbound url for /a4j/g/3_3_2.GAjquery.js
      17:24:07,938 INFO  [[/]] org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
      17:24:07,938 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /a4j/g/3_3_2.GA/org/ajax4jsf/framework.pack.js
      17:24:07,938 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /a4j/g/3_3_2.GA/org/ajax4jsf/framework.pack.js
      17:24:07,938 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /a4j/g/3_3_2.GA/org/ajax4jsf/framework.pack.js
      17:24:07,938 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /a4j/g/3_3_2.GA/org/ajax4jsf/framework.pack.js
      17:24:07,947 INFO  [[/]] org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
      17:24:07,947 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /a4j/g/3_3_2.GA/org/richfaces/ui.pack.js
      17:24:07,947 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /a4j/g/3_3_2.GA/org/richfaces/ui.pack.js
      17:24:07,948 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /a4j/g/3_3_2.GA/org/richfaces/ui.pack.js
      17:24:07,948 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /a4j/g/3_3_2.GA/org/richfaces/ui.pack.js
      17:24:07,956 INFO  [[/]] org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
      17:24:07,957 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /a4j/s/3_3_2.GA/org/richfaces/skin.xcss/DATB/eAFbkFjeHLp8hjQAEZwDqw__
      17:24:07,957 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /a4j/s/3_3_2.GA/org/richfaces/skin.xcss/DATB/eAFbkFjeHLp8hjQAEZwDqw__
      17:24:07,957 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /a4j/s/3_3_2.GA/org/richfaces/skin.xcss/DATB/eAFbkFjeHLp8hjQAEZwDqw__
      17:24:07,957 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /a4j/s/3_3_2.GA/org/richfaces/skin.xcss/DATB/eAFbkFjeHLp8hjQAEZwDqw__
      17:24:07,965 INFO  [[/]] org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
      17:24:07,965 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /a4j/g/3_3_2.GAjquery.js
      17:24:07,965 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /a4j/g/3_3_2.GAjquery.js
      17:24:07,965 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /a4j/g/3_3_2.GAjquery.js
      17:24:07,966 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /a4j/g/3_3_2.GAjquery.js
      17:24:07,975 INFO  [[/]] org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
      17:24:07,975 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /stylesheet/theme.css
      17:24:07,975 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /stylesheet/theme.css
      17:24:07,975 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /stylesheet/theme.css
      17:24:07,975 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /stylesheet/theme.css
      17:24:07,982 INFO  [[/]] org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
      17:24:07,982 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /img/jquery.js
      17:24:07,983 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /img/jquery.js
      17:24:07,983 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /img/jquery.js
      17:24:07,983 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /img/jquery.js
      17:24:08,042 INFO  [[/]] org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
      17:24:08,042 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /img/jquery.dropshadow.js
      17:24:08,042 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /img/jquery.dropshadow.js
      17:24:08,042 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /img/jquery.dropshadow.js
      17:24:08,042 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /img/jquery.dropshadow.js
      17:24:08,265 INFO  [[/]] org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
      17:24:08,265 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /img/logo.gif
      17:24:08,265 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /img/logo.gif
      17:24:08,266 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /img/logo.gif
      17:24:08,266 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /img/logo.gif
      17:24:08,278 INFO  [[/]] org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
      17:24:08,278 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /a4j/g/3_3_2.GAorg.richfaces.renderkit.html.GradientA/DATB/eAFjMFrEYLSICQAGOQGr
      17:24:08,278 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /a4j/g/3_3_2.GAorg.richfaces.renderkit.html.GradientA/DATB/eAFjMFrEYLSICQAGOQGr
      17:24:08,278 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /a4j/g/3_3_2.GAorg.richfaces.renderkit.html.GradientA/DATB/eAFjMFrEYLSICQAGOQGr
      17:24:08,278 INFO  [[/]] org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /a4j/g/3_3_2.GAorg.richfaces.renderkit.html.GradientA/DATB/eAFjMFrEYLSICQAGOQGr
      17:24:08,286 INFO  [[/]] org.tuckey.web.filters.urlrewrite.utils.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost
      17:24:08,286 INFO  [[/]] org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /img/sky.jpg







      But, when i request for web page using pretty URL http://localhost:8080/home then web page is displaying without applying rich-faces skin.and above log information is not displaying in log console.
       

                 Should i configure anything in web.xml file?

      I am using seam 2.1.2 and rich-faces 3.3.2 and urlrewritefilter.jar that came along seam2.1.2
       
      Can anybody help me on this.