3 Replies Latest reply on Mar 27, 2008 9:16 AM by targeter

    URLRewrite, MockViewHandler causing problems

    targeter

      Hi,


      I have an action that throws an exception, which I want to handle through pages.xml. When I'm not using URLRewrite, everything works fine. But when I specify an outbound filter for the page that call the action throwing an exception, this shows up in the log:



      2008-03-25 16:44:34,627 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/vl].[default]] Servlet.service() for servlet default threw exception
      java.lang.IllegalArgumentException: no file extension in servlet path: /signup




      This makes sense, given the following code in that class:


      int sploc = servletPath.lastIndexOf('.')
      if (sploc<0) throw new IllegalArgumentException("no file extension in servlet path: " + servletPath);




      I have two questions:



      1. Why is a mock viewhandler used? Shouldn't that only be used for testing?

      2. Why is it illegal to have a URL without a dot?



      of course, the real question I have is how do I fix it ;-)

        • 1. Re: URLRewrite, MockViewHandler causing problems
          targeter

          Sorry, can't seem to find the edit button.


          I'm missing a line in the first code block. It should read:



          2008-03-25 16:44:34,627 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/vl].[default]] Servlet.service() for servlet default threw exception
          java.lang.IllegalArgumentException: no file extension in servlet path: /signup
                  at org.jboss.seam.mock.MockViewHandler.getActionURL(MockViewHandler.java:44)
          


          • 2. Re: URLRewrite, MockViewHandler causing problems
            targeter

            The way I understand it now, the ViewHandler is trying to create a URL by looking at the request, which is the re-written URL that means nothing to Seam. How can I stop this from happening? I don't see why it needs a link to the current page, since it just needs to redirect to the error page.

            • 3. Re: URLRewrite, MockViewHandler causing problems
              targeter

              The solution, for those interested:


              Make sure the URLRewriteFilter comes before the Seam filter in web.xml.