Results 1 to 2 of 2

Thread: Problems with SimpleUrlMapping

  1. #1
    Join Date
    Sep 2005
    Posts
    5

    Default Problems with SimpleUrlMapping

    Hi,

    I've just put together my first Spring Web app and although it is all working fine I want to change some of the URLs. At the moment I am using "*.do" to represent actions and "*.htm" to represent static pages e.g.

    <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <props>
    <prop key="/cart.do">addToCart</prop>
    <prop key="/products.htm">products</prop>

    However, rather than using a URL like "/products.htm" for my products page I want to use the URL "/products/" as I would normally use if it were a true static page on Apache (obviously this would default to an index.html on the server but the user would not see the name of the page).

    Will Spring support using URLs in this way? Do I need to write a custom Handler?

    Thanks,

    Andy.

  2. #2
    Join Date
    Aug 2004
    Posts
    1,905

    Default

    Yes it will.

    Have a look at BeanNameUrlHandlerMapping for a more convenient implementation BTW

    Anyways, you would change your mapping to "/products" or "/products/*".

    HTH.

Similar Threads

  1. Replies: 2
    Last Post: Sep 9th, 2005, 03:14 AM
  2. Spring IDE problems with Eclipse 3.1
    By biguniverse in forum SpringSource Tool Suite
    Replies: 5
    Last Post: Aug 20th, 2005, 06:01 AM
  3. Quarts Scheduler Problems (again)
    By Alarmnummer in forum Container
    Replies: 1
    Last Post: Jul 29th, 2005, 03:34 AM
  4. MVC step-by-step problems
    By joegaber in forum Web
    Replies: 2
    Last Post: Jul 25th, 2005, 10:16 AM
  5. dependency problems?
    By asaf.lahav in forum Data
    Replies: 3
    Last Post: Jul 21st, 2005, 03:36 PM

Posting Permissions

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