Back Forum Reply New

Error 404 MultiActionController

Hello
i try to use MultiActionController.
i make one controller (StagiaireController) wich extends MultiActionController, and have 3 methods: one for add instance, one for delete and one for list entities.
I wrote one jsp file which names: crudStagiaire.jsp
In my file-servlet.xml, i have:

Code:
lt;bean id=quot;stagiaireControllerquot; class=quot;fr.envt.formco.controler.StagiaireControllerquot;gt; lt;property name=quot;stagiaireManagerquot; ref=quot;stagiaireManagerquot;/gt; lt;property name=quot;crudStagiairequot; ref=quot;crudStagiairequot;/gt; lt;property name=quot;methodNameResolverquot;gt;lt;ref bean=quot;stagiaireControllerResolverquot;/gt;lt;/propertygt; lt;/beangt;

lt;bean id=quot;stagiaireControllerResolverquot; class=quot;org..web.servlet.mvc.multiaction.PropertiesMethodNameResolverquot;gt; lt;property name=quot;mappingsquot;gt; lt;propsgt; lt;prop key=quot;/stagiaire/add.htmquot;gt;addlt;/propgt; lt;prop key=quot;/stagiaire/remove.htmquot;gt;removelt;/propgt; lt;prop key=quot;/stagiaire/list.htmquot;gt;listlt;/propgt; lt;/propsgt; lt;/propertygt; lt;/beangt;
lt;bean id = quot;viewResolverquot; class = quot;org..web.servlet.view.InternalResourceViewResolverquot;gt;   lt;property name = quot;viewClassquot; value = quot;org..web.servlet.view.JstlViewquot; /gt;   lt;property name = quot;prefixquot; value = quot;/WEB-INF/jsp/quot; /gt;   lt;property name = quot;suffixquot; value = quot;.jspquot; /gt;   lt;property name = quot;orderquot; value=quot;1quot;/gt; lt;/beangt;
When i try to access those ucl, i obtain 404 Error:
MyProjetc/crudStagiaire.htm
MyProjetc/stagiaire/add.htm
MyProjetc/stagiaire/list.htm
MyProjetc/stagiaire/remove.htm

I can't find any solution. Could you please send me any examples, or any link to find solution?
Do i have to use ResourceBundleViewResolver instead viewResolver?
Thank for any reply
JBA

i tried XmlViewResolver without any result.
i renamed methods like this:
Code:
lt;bean id=quot;stagiaireControllerResolverquot; class=quot;org..web.servlet.mvc.multiaction.PropertiesMethodNameResolverquot;gt; lt;property name=quot;mappingsquot;gt; lt;propsgt; lt;prop key=quot;/stagiaire/add.htmquot;gt;addStagiairelt;/propgt; lt;prop key=quot;/stagiaire/remove.htmquot;gt;removeStagiairelt;/propgt; lt;prop key=quot;/stagiaire/list.htmquot;gt;listStagiairelt;/propgt; lt;/propsgt; lt;/propertygt; lt;/beangt;
but it's the same.
I can't access to this page and methods.
any help will be appreciate
JBA

hello. i'm answering myself.
in myapp-servlet.xml, i defined 2 viewResolvers, and 2 handler

Code:

lt;bean id=quot;xmlViewResolverquot; class=quot;org..web.servlet.view.XmlViewResolverquot;gt; lt;property name=quot;locationquot; value=quot;/WEB-INF/formco-views.xmlquot;/gt;   lt;property name = quot;orderquot; value=quot;0quot;/gt; lt;/beangt;
lt;bean id = quot;viewResolverquot; class = quot;org..web.servlet.view.InternalResourceViewResolverquot;gt;   lt;property name = quot;viewClassquot; value = quot;org..web.servlet.view.JstlViewquot; /gt;   lt;property name = quot;prefixquot; value = quot;/WEB-INF/jsp/quot; /gt;   lt;property name = quot;suffixquot; value = quot;.jspquot; /gt;   lt;property name = quot;orderquot; value=quot;1quot;/gt; lt;/beangt;

lt;bean class=quot;org..web.servlet.mvc.support.ControllerClassNameHandlerMappingquot;gt; lt;property name=quot;orderquot; value=quot;1quot;/gt; lt;/beangt;
lt;bean class=quot;org..web.servlet.handler.SimpleuclHandlerMappingquot;gt;lt;property name=quot;mappingsquot;gt;lt;propsgt;lt;prop key=quot;/hello.htmquot;gt;hellolt;/propgt;lt;/propsgt;lt;/propertygt; lt;property name=quot;orderquot; value=quot;0quot;/gt; lt;/beangt;
MultiActionController is defined like this:
Code:
lt;bean id=quot;stagiaireControllerResolverquot; class=quot;org..web.servlet.mvc.multiaction.PropertiesMethodNameResolverquot;gt; lt;property name=quot;mappingsquot;gt; lt;propsgt; lt;prop key=quot;/stagiaire/add.htmquot;gt;addStagiairelt;/propgt; lt;prop key=quot;/stagiaire/remove.htmquot;gt;removeStagiairelt;/propgt; lt;prop key=quot;/stagiaire/list.htmquot;gt;listStagiairelt;/propgt; lt;/propsgt; lt;/propertygt; lt;/beangt;
Method listStagiaire :Code:
public ModelAndView listStagiaire(fromServletRequest request, fromServletResponse response) throws Exception
{
Listlt;Stagiairegt; listStagiaires = stagiaireManager.getStagiaires();
crudStagiaire.setListStagiaires(listStagiaires);
return new ModelAndView(quot;listedestagiairesquot;,quot;crudStagiairequot;,crudStagiaire);
}
and in formco-views.xml, i defined:

Code:
lt;bean name=quot;listedestagiairesquot; class=quot;org..web.servlet.view.JstlViewquot;gt;      lt;property name=quot;uclquot; value=quot;/WEB-INF/jsp/stagiaireList.jspquot;/gt;      lt;/beangt;
it seems to work.
bye
¥
Back Forum Reply New