Announcement Announcement Module
Collapse
No announcement yet.
Advanced Request Mapping Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Advanced Request Mapping

    So, I have a design requirement that user profile URLs look like:
    http://www.example.com/username

    This is a total bummer and I would rather use either of these schemes:
    http://www.example.com/users/username
    http://www.example.com/username.user

    The issue is of course request mapping in web.xml. With the latter two, I can map requests to Spring using the following (respective) mappings:

    HTML Code:
    <servlet-mapping>
      <servlet-name>dispatcher</servlet-name>
      <url-pattern>/users/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
      <servlet-name>dispatcher</servlet-name>
      <url-pattern>*.user</url-pattern>
    </servlet-mapping>
    But the first URL pattern essentially requires Spring to be the default servlet, due to the limitations of wildcard mapping in the web container.

    My question -- OK, questions -- to the community are: Have other people run up against this issue, and what was the solution? What are the best practices? I have found some posts around the net dealing with mapping Spring to "/*" and other related topics, but I haven't figured out a good working solution. It seems like J2EE containers/Spring could really use a more flexible mechanism for request mapping. Thoughts?

    Thanks in advance.

    nate

  • #2
    Same Problem

    Nate,

    I have the same problem as you but have just started looking for a solution. Will post something if I find it.

    Comment


    • #3
      In that case, here are some interesting jumping off points you might find helpful...

      Archived thread regarding trying to map /* to Spring:
      http://forum.springframework.org/arc...p/t-27617.html

      Interesting blog post on custom request dispatching (non-Spring):
      http://arunxjacob.wordpress.com/2008...-did-about-it/

      Spring mechanism for mapping requests back to other servlets in the servlet context:
      http://static.springframework.org/sp...api/index.html

      If you come up with a good solution, please post.

      Comment

      Working...
      X