Back Forum Reply New

MultiAction Controller and default method call

Hi all,

I am a newbie in spring and have a very simple question that got me stuck for a while.

I have 2 page views, Admin Login (adminLogin.htm) and User Login (simply login.htm) and they are mapping to one MultiActionController in my servlet.xml to be

lt;bean id=quot;uclMappingquot;
class=quot;org..web.servlet.handler.Sim  pleuclHandlerMappingquot;gt;
lt;property name=quot;mappingsquot;gt;
lt;propsgt;
lt;prop key=quot;/login.htmquot;gt;loginControllerlt;/propgt;                    lt; prop key=quot;/adminLogin.htmquot;gt;loginControllerlt;/propgt;
lt;/propsgt;
lt;/propertygt;
lt;/beangt;

and this as my bean config

lt;bean id=quot;loginControllerquot; class=quot;web.LoginControllerquot;gt;
lt;property name=quot;methodNameResolverquot;gt;
lt;ref bean=quot;paramResolverquot; /gt;
lt;/propertygt;
lt;/beangt;

where i set my paramName to be quot;methodquot;.

Say i have methods called login() and adminLogin()
how can i get my mapping to directly call these methods ?
What is happening now is that if i request for
login.htm?method=login then it will invoke the login() method  but when i simply type login.htm..i have a 404 error...
I know that InternalPathMethodNameResolver will do the job. but then this is not really what i want to do, because when i submit my login form, i have an hidden field called quot;methodquot; that will tell my controller to invoke the correct method.

I thank you guys for the help in advance!!

- Herman
¥
Back Forum Reply New