Results 1 to 4 of 4

Thread: Any way to force DispatcherServlet to exclude a set paths

  1. #1
    Join Date
    May 2008
    Posts
    6

    Default Any way to force DispatcherServlet to exclude a set paths

    When I map my DispatcherServlet to "/", I lose the ability to access static content not under Spring's controll (e.g. /css/global.css). I am using restful urls throughout my application, so cannot filter the mapping (like "/*.htm"). Is there any facility within SpringMVC to allow me to exclude these directories, either through configuration or through a custom class?

  2. #2

    Default

    if you had apache httpd in front of your application server, you could get it to send static content like images + css + js

    If you are using tomcat for example, you would use modjk and some configuration like this

    # Send everything to app server
    JkMount /* worker

    # Serve js, css, jpg using httpd
    JkUnMount /js/*.js worker
    JkUnMount /css/*.css worker
    JkUnMount /images/*.jpg worker

  3. #3
    Join Date
    May 2008
    Posts
    6

    Default

    Thanks for the direction, but I was hoping for a portable solution that did not involve external configuration. That is a great tip, and one i will be sure to remember!

  4. #4
    Join Date
    Jan 2007
    Posts
    5

    Default

    hi rkroll, I'm looking at the same issue, did you find a workaround?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •