You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "jimjohn83@gmail.com" <ji...@gmail.com> on 2011/05/02 11:49:57 UTC
Multiple controller
Hi
Can anybody give configuration to handle 2 controller?
For the first controller my url-pattern will be *.do and for the second one
it will be *.au
Can any body help me?
Thanks
--
View this message in context: http://struts.1045723.n5.nabble.com/Multiple-controller-tp4364290p4364290.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Multiple controller
Posted by "jimjohn83@gmail.com" <ji...@gmail.com>.
Hi
My code is as follolws .
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config/</param-name>
<param-value>/WEB-INF/conf/struts/struts-config-1.xml</param-value>
</init-param>
</servelt>
<servlet>
<servlet-name>action2</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config/</param-name>
<param-value>/WEB-INF/conf/struts/struts-config-2.xml</param-value>
</init-param>
</servelt>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action2</servlet-name>
<url-pattern>*.au</url-pattern>
</servlet-mapping>
In the controller tag of struts-config 1 and 2 i have put classes say class1
and class2 which extend RequestProcessor.
but when *.au request is made it is not getting into class2 instead it is
getting into class1
--
View this message in context: http://struts.1045723.n5.nabble.com/Multiple-controller-tp4364290p4364494.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Multiple controller
Posted by Maurizio Cucchiara <ma...@gmail.com>.
Probably I would use filter-mapping
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
On 2 May 2011 12:19, Maurizio Cucchiara <ma...@gmail.com> wrote:
> I'm not sure I understand what you exactly mean, but have you tried to
> map the url through the web.xml?
> for example:
>
> <servlet-mapping>
> <servlet-name>struts-1</servlet-name>
> <url-pattern>*.do</url-pattern>
> </servlet-mapping>
>
> <servlet-mapping>
> <servlet-name>struts-2</servlet-name>
> <url-pattern>*.au</url-pattern>
> </servlet-mapping>
>
>
>
> On 2 May 2011 11:49, jimjohn83@gmail.com <ji...@gmail.com> wrote:
>>
>> Hi
>>
>> Can anybody give configuration to handle 2 controller?
>>
>> For the first controller my url-pattern will be *.do and for the second one
>> it will be *.au
>>
>> Can any body help me?
>>
>> Thanks
>>
>> --
>> View this message in context: http://struts.1045723.n5.nabble.com/Multiple-controller-tp4364290p4364290.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
>
> --
> Maurizio Cucchiara
>
--
Maurizio Cucchiara
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Multiple controller
Posted by Maurizio Cucchiara <ma...@gmail.com>.
I'm not sure I understand what you exactly mean, but have you tried to
map the url through the web.xml?
for example:
<servlet-mapping>
<servlet-name>struts-1</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>struts-2</servlet-name>
<url-pattern>*.au</url-pattern>
</servlet-mapping>
On 2 May 2011 11:49, jimjohn83@gmail.com <ji...@gmail.com> wrote:
>
> Hi
>
> Can anybody give configuration to handle 2 controller?
>
> For the first controller my url-pattern will be *.do and for the second one
> it will be *.au
>
> Can any body help me?
>
> Thanks
>
> --
> View this message in context: http://struts.1045723.n5.nabble.com/Multiple-controller-tp4364290p4364290.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
--
Maurizio Cucchiara
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org