Announcement Announcement Module
Collapse
No announcement yet.
Different URL pattern for controllers Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Any ideas??

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

    Comment


    • #3
      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/

      Comment

      Working...
      X