This week's book giveaways are in the Angular and TypeScript and Web Services forums.
We're giving away four copies each of Programming with Types and The Design of Web APIs and have the authors on-line!
See this thread and this one for details.
Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

about spring framework

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any one help me how to implement multiactions in a single controller.
like add,view, update.
please help me.
thanks in advance.
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You need to extend from org.springframework.web.servlet.mvc.multiaction.MultiActionController in order to aggregate multiple actions in a single class.

Regards,
P R A V E E N
 
sruthi das
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, I am using multiactioncontroller.
the problem is it is not going into the controller.
here is the xml file
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN/EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>


<bean id="propsResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
<property name="mappings">
<props>
<prop key="/add.html">add</prop>
<prop key="/view.html">view</prop>

</props>

</property>
</bean>

<bean id="paramMultiController" class="org.springframework.web.servlet.mvc.multiaction.MultiActionController">
<property name="methodNameResolver" ref="propsResolver"></property>
<property name="delegate" ref="addController"></property>
</bean>

<bean id="addController" class="bean.AddController"/>
<bean id="log" class="bean.Formbean"/>

</beans>
here add,view are methods in addcontroller.
help me how to solve.getting 404 error
 
Praveen Babu
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
404 Error occurs when you have problems with your file path. Anyway, the following works fine for me.

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/hello.htm">myController</prop>
<prop key="/second.htm">myController</prop>
</props>
</property>
</bean>


<bean id="myController" class="pkg.SimpleController">
<property name="methodNameResolver" ref="controllerResolver"/>
</bean>

<bean id="controllerResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
<property name="mappings">
<props>
<prop key="/hello.htm">handleHello</prop>
<prop key="/second.htm">handleSecond</prop>
</props>
</property>
</bean>

Regards,
P R A V E E N
 
sruthi das
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanq very much.
now my code is working
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!