PDA

View Full Version : configure multiactionController and regular one help!


pinglu
08-19-2004, 11:43 AM
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/imagelist.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.multiaction.Pr opertiesMethodNameResolver">
<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.PriceIncreaseFormController"/>

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlH andlerMapping">
<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.InternalResou rceViewResolver">
<property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property>
<property name="prefix"><value>/WEB-INF/jsp/</value></property>
<property name="suffix"><value>.jsp</value></property>
</bean>

pinglu
08-19-2004, 02:15 PM
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.

lemiorhan
08-20-2004, 05:11 AM
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