Announcement Announcement Module
Collapse
No announcement yet.
configure multiactionController and regular one help! Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • configure multiactionController and regular one help!

    Hi,
    I try to config one multiactionController with two regular Controllers, no luck, access
    http://localhost:8080/springapp/imagelist.htm
    http://localhost:8080/springapp/imageList
    http://localhost:8080/springapp/imag...html=imageList
    some were 404 errors, some were "No handling method can be found for request"
    please advise! here is my config file:

    <bean id="imageController" class="com.ping.springmvc.ImageController">
    <property name="methodNameResolver"><ref local="imageControllerResolver"/></property>

    </bean>

    <!-- Method resolution strategy for the MultiActionController above -->
    <bean id="imageControllerResolver" class="org.springframework.web.servlet.mvc.multiac tion.PropertiesMethodNameResolver">
    <property name="mappings">
    <props>
    <prop key="/imageList">showImageList</prop>
    <prop key="/imageContent">streamImageContent</prop>
    <prop key="/imageUpload">processImageUpload</prop>
    <prop key="/clearDatabase">clearDatabase</prop>
    </props>
    </property>
    </bean>

    <bean id="priceIncreaseValidator" class="bus.PriceIncreaseValidator"/>
    <bean id="priceIncreaseForm" class="com.ping.springmvc.PriceIncreaseFormControl ler"/>

    <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <props>
    <prop key="/hello.htm">springappController</prop>
    <prop key="/priceincrease.htm">priceIncreaseForm</prop>
    <prop key="/imagelist.htm">imageController</prop>
    </props>
    </property>
    </bean>
    <bean id="viewResolver" class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
    <property name="viewClass"><value>org.springframework.web.se rvlet.view.JstlView</value></property>
    <property name="prefix"><value>/WEB-INF/jsp/</value></property>
    <property name="suffix"><value>.jsp</value></property>
    </bean>

  • #2
    I used two DispatcherServlets in web.xml

    I seperated to two DispatcherServlets, split config file to two, springapp-servlet.xml and image-servlet.xml, it works fine, but I do not know if this is the right way.

    Comment


    • #3
      hi,

      http://localhost:8080/springapp/imagelist.htm

      I advice you to assign standard URL to the requests. The first URL of the three seems OK for me. If imagelist.htm is used, you should add

      <prop key="imagelist.htm">imageController</prop>

      to urlHandlerMapping and

      <prop key="/imagelist.htm">showImageList</prop>

      to the method name resolver. There should be a method "showImageList" is your multiActionController.

      --
      Lemi Orhan Ergin

      Comment

      Working...
      X