1 Reply Latest reply on May 30, 2011 8:03 PM by Tim Evers

    Seam Resource Servlet

    roger manning Newbie

      Hi,
      We're using seam as our web framework and I was just wondering how to get more information on what types of content the Seam resource servlet covers?


      Looking at the seam docs it mentions captcha and remoting, etc. and I took a look at the seam source and saw the image resources, etc.
      But what I really want is a full list of the resources that the servlet recognises?


      For example, within our framewok we have some generated html pages that reside under our /docs folder of our project.
      We've configured the seam resource servlet to :-


      |<servlet>
        <servlet-name>Seam Resource Servlet</servlet-name>
        <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
       </servlet>
      ...
       <servlet-mapping>
        <servlet-name>Seam Resource Servlet</servlet-name>
        <url-pattern>/seam/resource/*</url-pattern>
       </servlet-mapping>|



      Now when we redirect to the url seam/resource/document/(filename).html , instead of the html pages being served as html and thus the browser displaying the page as html, it's serving the .html file as a file and thus the user is asked whether they want to save or open the document.


      I get that we've put the html files in the wrong place so the resource servlet thinks they are documents but because I don't know all the resource servlets mappings, I can't work out where these html pages should sit?


      Any help would be appreciated.



      PS. The need to have the files served by the resource servlet is pretty strict for reasons I won't outline here, so just suggesting that we move the files elsewhere is not a solution, I'd like a bit more information regarding the seam resource servlet and why we shouldn't use it if this is what you suggest.

        • 1. Re: Seam Resource Servlet
          Tim Evers Master

          I don't have an answer exactly cause I don't have the time to work it all out atm.


          But, I think if you read the following links it may point you in the right direction.


          The idea would be to exclude any .html files from the servlet.


          Link 1


          Link 2 - read the follow up post.


          Link 3


          Now, I think that the idea behind those links should work for what you are trying to do, but I'm not an expert in that area so I can't afford to spend the time working it out for you. Hopefully you'll make sense of it. If you do get it working would you mind posting your solution here? :P


          Cheers,
          Tim