Results 1 to 3 of 3

Thread: Different URL pattern for controllers

  1. #1
    Join Date
    Dec 2008
    Posts
    15

    Default Different URL pattern for controllers

    Hi,

    I would like my web app to have urls like this:
    www.example.com/home
    www.example.com/contacts
    www.example.com/register

    But if I put this in web.xml to be able to do that:
    Code:
    <servlet-mapping>
    	<servlet-name>spring-servlet</servlet-name>
    	<url-pattern>/*</url-pattern>
    </servlet-mapping>
    my application cannot load resources like images, styles and scripts because all requests are now going through the spring servlet, and it does not find these resources.

    Does anyone knows how to manage that??

    Thanks in advance,
    Vitor.

  2. #2
    Join Date
    Dec 2008
    Posts
    15

    Default

    Any ideas??

    It shouldn't be that hard.
    But I just can't find anything about it!

  3. #3
    Join Date
    Jan 2009
    Location
    Europe
    Posts
    18

    Default

    Quote Originally Posted by fvitorc View Post
    Any ideas??

    It shouldn't be that hard.
    But I just can't find anything about it!
    how do you create a path to a resource (image, js or style etc. )?

    may be it will work?

    Code:
    <img src="<c:url value='img/image.gif'/>" />
    Of course, if
    Code:
    /web/
    /web/img/

Posting Permissions

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