4 Replies Latest reply on Jan 10, 2008 6:20 AM by David Spark

    Easiest way to disable UrlRewrite in Seam examples?

    David Spark Newbie

      I'm trying to gain inspiration from the Seam examples (the Wiki one in this case) but it would be handy if I could see the actual URLs to help me figure out in my head what's going on. What's the simplest way to turn off the UrlRewrite functionality so I can see the bare URLs?

      Thanks!

        • 1. Re: Easiest way to disable UrlRewrite in Seam examples?
          Shane Bryzak Master

          Simply remove the UrlRewriteFilter section in web.xml.

          • 2. Re: Easiest way to disable UrlRewrite in Seam examples?
            David Spark Newbie

            For the Wiki example there's no UrlRewriteFilter section in web.xml, but there was something in Components.xml. I tried removing the following code from Components.xml:

            <component name="wikiUrlRewriteFilter" class="org.jboss.seam.wiki.core.ui.WikiUrlRewriteFilter" precedence="30">
             <property name="initParameters">
             <key>logLevel</key><value>WARN</value>
             <key>statusEnabled</key><value>false</value>
             </property>
             </component>


            But then when I tried to deploy it I get the following error:
            10:30:20,628 INFO [SeamFilter] Initializing filter: org.jboss.seam.web.contextFilter
            10:30:20,628 INFO [SeamFilter] Initializing filter: wikiUrlRewriteFilter
            10:30:20,644 ERROR [[/wiki]] Exception starting filter Seam Filter
            java.lang.NullPointerException:
             at org.jboss.seam.wiki.core.ui.WikiUrlRewriteFilter$FilterConfigWrapper.getInitParameter(WikiUrlRewriteFilter.java:72)
             at org.tuckey.web.filters.urlrewrite.utils.Log.setConfiguration(Log.java:563)
             at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.init(UrlRewriteFilter.java:214)
             at org.jboss.seam.wiki.core.ui.WikiUrlRewriteFilter.init(WikiUrlRewriteFilter.java:40)
             at org.jboss.seam.servlet.SeamFilter.init(SeamFilter.java:97)
             at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
             at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
             at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
             at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3720)
             at org.apache.catalina.core.StandardContext.start(StandardContext.java:4365)
             at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
             at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
             at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
             at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
             at org.apache.catalina.core.StandardContext.init(StandardContext.java:5310)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
             at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
             at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
            10:30:20,644 ERROR [StandardContext] Error filterStart

            Which I guess makes sense now I've removed that data it's looking for but doesn't really help me :-)

            • 3. Re: Easiest way to disable UrlRewrite in Seam examples?
              Pete Muir Master

              Try disabling it using

              <component name="wikiUrlRewriteFilter" class="org.jboss.seam.wiki.core.ui.WikiUrlRewriteFilter" precedence="30">
               <property name="initParameters">
               <key>logLevel</key><value>WARN</value>
               <key>statusEnabled</key><value>false</value>
               </property>
               <property name="disabled">true</property>
               </component>


              But no guarantee the wiki will still work...

              • 4. Re: Easiest way to disable UrlRewrite in Seam examples?
                David Spark Newbie

                Unfortunately that didn't work, I get the error:

                java.lang.IllegalArgumentException: no such setter method: org.jboss.seam.wiki.core.ui.WikiUrlRewriteFilter.disabled


                I also tried removing the line
                <include name="urlrewrite*.jar" />
                from build.xml but when I do this there's no errors starting the server but I get an Error 404 when I try to load the page.

                Anyway, it's not super important, just thought it would make understanding the examples a bit easier :-)