Results 1 to 3 of 3

Thread: mapping url requests to spring but with exceptions

  1. #1
    Join Date
    Apr 2009
    Posts
    3

    Default mapping url requests to spring but with exceptions

    Hey Guys,

    I am trying to get all requests going into the spring dispatcher servlet but with exceptions.

    So, I want urls such as

    /myapp/this
    /myapp/that/and
    /myapp/that/and/the-other

    Into Spring. But I do not want

    /images/*
    /css/*

    Handled by Spring.

    Can anyone suggest a way of doing this? Right now I can get all requests or no requests going into Spring.

    I do not want to use a servlet url-mapping that specifies an extension.

    E.g. I do not want to use a mapping of *.ext as I find this a little ugly/antiquated and specific to java servlet development.

  2. #2
    Join Date
    Apr 2009
    Posts
    3

    Default

    ok so i guess i can create an extra path segment /app/ (not ideal though)

    servlet:
    <url-pattern>/app/*</url-pattern>

    handler:
    /home=homeController

    would be good to achieve this without the extra path segment ...

  3. #3
    Join Date
    Feb 2006
    Location
    Nancy, France
    Posts
    145

    Default

    You are allowed to use multiple mappings for a servlet :

    Code:
    <servlet-mapping>
      <servlet-name>spring-servlet</servlet-name>
      <url-pattern>/this/*</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
      <servlet-name>spring-servlet</servlet-name>
      <url-pattern>/that/*</url-pattern>
    </servlet-mapping>
    Université Nancy 2
    France

Posting Permissions

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