Announcement Announcement Module
No announcement yet.
No mapping for [/SpringApp/price.htm] in DispatcherServlet with name 'springapp' Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • No mapping for [/SpringApp/price.htm] in DispatcherServlet with name 'springapp'

    I'm a spring newbie.. I'm following the Spring Framework MVC application step-by-step tutorial.. I'm using netbeans 6.1 and jdk 1.6. I was able to develop and run the application upto adding a form. but when I added a form to increase the price with PriceIncreaseFormController I get

    No mapping for [/SpringApp/price.htm] in DispatcherServlet with name 'springapp'

    error on glassfish V2 output window.

    my Web application context is as follows..Here Im unable to add xsi:schemaLocation since it's not allowed to post urls until i make 15 posts..It's as in the tutorial though..

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="I can't use urls"

    <bean class=" .ControllerClassNameHandlerMapping"/>

    Most controllers will use the ControllerClassNameHandlerMapping above, but
    for the index controller we are using ParameterizableViewController, so we must
    define an explicit mapping for it.
    <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <prop key="/index.htm">indexController</prop>

    <bean id="productManager" class="springapp.service.SimpleProductManager">
    <property name="products">
    <ref bean="product1"/>
    <ref bean="product2"/>
    <ref bean="product3"/>

    <bean id="product1" class="springapp.domain.Product">
    <property name="description" value="Lamp"/>
    <property name="price" value="5.75"/>

    <bean id="product2" class="springapp.domain.Product">
    <property name="description" value="Table"/>
    <property name="price" value="75.25"/>

    <bean id="product3" class="springapp.domain.Product">
    <property name="description" value="Chair"/>
    <property name="price" value="22.79"/>

    <bean id="messageSource" class=" eBundleMessageSource">
    <property name="basename" value="messages"/>

    <bean name="/price.htm" class="springapp.web.PriceIncreaseFormController">
    <property name="sessionForm" value="true"/>
    <property name="commandName" value="priceIncrease"/>
    <property name="commandClass" value="springapp.service.PriceIncrease"/>
    <property name="validator">
    <bean class="springapp.service.PriceIncreaseValidator"/>
    <property name="formView" value="priceincrease.htm"/>
    <property name="successView" value="hello.htm"/>
    <property name="productManager" ref="productManager"/>

    <bean id="viewResolver"
    class="org.springframework.web.servlet.view.Intern alResourceViewResolver"
    p:viewClass="org.springframework.web.servlet.view. JstlView"
    p:suffix=".jsp" />

    The index controller.
    <bean name="indexController"
    class="org.springframework.web.servlet.mvc.Paramet erizableViewController"
    p:viewName="index" />

    <bean name="/hello.htm" class="springapp.web.HelloController">
    <property name="productManager" ref="productManager"/>


    I guess the error is in this xml. Can anyone please help me on this?

    Thanks in advance..

  • #2
    Please use [ code][/code ] tags when posting code.

    First off all I recommend that you check the javadocs for the HandlerMapping classes you use. After that register a BeanNameHandlerMapping.