Announcement Announcement Module
No announcement yet.
Any way to force DispatcherServlet to exclude a set paths Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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
      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
        hi rkroll, I'm looking at the same issue, did you find a workaround?