You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Franck Lefebure <fl...@orangecaraibe.com> on 2003/09/24 21:39:10 UTC
Multi config files and global forward
Hello,
My web.xml looks like :
<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/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>config/news</param-name>
<param-value>/WEB-INF/conf/struts-config-news.xml</param-value>
</init-param>
...............
In /WEB-INF/struts-config.xml , I have the following action :
<global-forwards>
<forward name="error" path="/doError.do"/>
</global-forwards>
<action-mappings>
<action path = "/doError" scope="request"
type="com.orange.struts.actions.ErrorAction">
<forward name="success" path="/error.jsp" redirect="false"/>
</action>
</action-mappings>
I want in /WEB-INF/conf/struts-config-news.xml to define global-forward
towards the /doError.do in the main file :
Something like :
<global-forwards>
<forward name="error" path="/../doError.do"/>
</global-forwards>
But, It doesn't work. If I add redirect="true" : <forward name="error"
path="/../doError.do" redirect="true"/>
Then it's ok But I would like to keep my request scope
An idea ?
Thanks
Franck
--
Franck Lefebure
equipe web http://www.orangecaraibe.com
mailto:flefebure@orange.gp
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Multi config files and global forward
Posted by Navneet Karnani <na...@myrealbox.com>.
Do you intend to make these different modules ? If not, then this is the
wrong way to split files. You must use the xml way of splitting the
files, or give the config files in the same param-value tag seperated by
comma.
- Navneet
Umber Business Solutions Pvt Ltd
http://www.umber.biz
Franck Lefebure said the following on 25/09/2003 1:09 AM:
> Hello,
>
> My web.xml looks like :
>
> <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/struts-config.xml</param-value>
> </init-param>
> <init-param>
> <param-name>config/news</param-name>
> <param-value>/WEB-INF/conf/struts-config-news.xml</param-value>
> </init-param>
> ...............
>
> In /WEB-INF/struts-config.xml , I have the following action :
>
> <global-forwards>
> <forward name="error" path="/doError.do"/>
> </global-forwards>
>
> <action-mappings>
> <action path = "/doError" scope="request"
> type="com.orange.struts.actions.ErrorAction">
> <forward name="success" path="/error.jsp" redirect="false"/>
> </action>
> </action-mappings>
>
> I want in /WEB-INF/conf/struts-config-news.xml to define global-forward
> towards the /doError.do in the main file :
>
> Something like :
>
> <global-forwards>
> <forward name="error" path="/../doError.do"/>
> </global-forwards>
>
> But, It doesn't work. If I add redirect="true" : <forward name="error"
> path="/../doError.do" redirect="true"/>
> Then it's ok But I would like to keep my request scope
>
> An idea ?
> Thanks
> Franck
>
>
> --
> Franck Lefebure
> equipe web http://www.orangecaraibe.com
> mailto:flefebure@orange.gp
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Multi config files and global forward
Posted by Franck Lefebure <fl...@orangecaraibe.com>.
Thanks for the *contextRelative="true"* tip
Regards
--
Franck Lefebure
equipe web http://www.orangecaraibe.com
mailto:flefebure@orange.gp
0590323872
0690569880
----- Original Message -----
From: "Manish Singla" <Ma...@Sun.COM>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, September 24, 2003 6:18 PM
Subject: Re: Multi config files and global forward
> Try this
> <forward contextRelative="true" name="error" path="/doError.do"/> in
> /WEB-INF/conf/struts-config-news.xml
>
>
>
> Franck Lefebure wrote:
> > Well,
> > I learned this way of using muti-config modules in the article
> >
> > http://www.onjava.com/pub/a/onjava/pub/a/2002/11/06/struts1.html?page=2
> >
> > I don't have any problem with it but I'm looking for
> > the smartest way to define a all-modules global-forward
> >
> > ... Or the smartest way to handle exception in a multi-module struts
> > configuration !
> >
> > Thanks
> > --
> > Franck Lefebure
> > equipe web http://www.orangecaraibe.com
> > mailto:flefebure@orange.gp
> > 0590323872
> > 0690569880
> > ----- Original Message -----
> > From: "Navneet Karnani" <na...@myrealbox.com>
> > To: <st...@jakarta.apache.org>
> > Sent: Wednesday, September 24, 2003 3:49 PM
> > Subject: Re: Multi config files and global forward
> >
> >
> >
> >>Do you intend to make these different modules ? If not, then this is the
> >>wrong way to split files. You must use the xml way of splitting the
> >>files, or give the config files in the same param-value tag seperated by
> >>comma.
> >>
> >>- Navneet
> >>Umber Business Solutions Pvt Ltd
> >>http://www.umber.biz
> >>
> >>Franck Lefebure said the following on 25/09/2003 1:09 AM:
> >>
> >>>Hello,
> >>>
> >>>My web.xml looks like :
> >>>
> >>><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/struts-config.xml</param-value>
> >>> </init-param>
> >>> <init-param>
> >>> <param-name>config/news</param-name>
> >>> <param-value>/WEB-INF/conf/struts-config-news.xml</param-value>
> >>> </init-param>
> >>> ...............
> >>>
> >>>In /WEB-INF/struts-config.xml , I have the following action :
> >>>
> >>> <global-forwards>
> >>> <forward name="error" path="/doError.do"/>
> >>> </global-forwards>
> >>>
> >>> <action-mappings>
> >>> <action path = "/doError" scope="request"
> >>>type="com.orange.struts.actions.ErrorAction">
> >>> <forward name="success" path="/error.jsp" redirect="false"/>
> >>> </action>
> >>> </action-mappings>
> >>>
> >>>I want in /WEB-INF/conf/struts-config-news.xml to define
global-forward
> >>>towards the /doError.do in the main file :
> >>>
> >>>Something like :
> >>>
> >>> <global-forwards>
> >>> <forward name="error" path="/../doError.do"/>
> >>> </global-forwards>
> >>>
> >>>But, It doesn't work. If I add redirect="true" : <forward name="error"
> >>>path="/../doError.do" redirect="true"/>
> >>>Then it's ok But I would like to keep my request scope
> >>>
> >>>An idea ?
> >>>Thanks
> >>>Franck
> >>>
> >>>
> >>>--
> >>>Franck Lefebure
> >>>equipe web http://www.orangecaraibe.com
> >>>mailto:flefebure@orange.gp
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> --
> Thanks
> Manish Singla
> x73166
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Multi config files and global forward
Posted by Manish Singla <Ma...@Sun.COM>.
Try this
<forward contextRelative="true" name="error" path="/doError.do"/> in
/WEB-INF/conf/struts-config-news.xml
Franck Lefebure wrote:
> Well,
> I learned this way of using muti-config modules in the article
>
> http://www.onjava.com/pub/a/onjava/pub/a/2002/11/06/struts1.html?page=2
>
> I don't have any problem with it but I'm looking for
> the smartest way to define a all-modules global-forward
>
> ... Or the smartest way to handle exception in a multi-module struts
> configuration !
>
> Thanks
> --
> Franck Lefebure
> equipe web http://www.orangecaraibe.com
> mailto:flefebure@orange.gp
> 0590323872
> 0690569880
> ----- Original Message -----
> From: "Navneet Karnani" <na...@myrealbox.com>
> To: <st...@jakarta.apache.org>
> Sent: Wednesday, September 24, 2003 3:49 PM
> Subject: Re: Multi config files and global forward
>
>
>
>>Do you intend to make these different modules ? If not, then this is the
>>wrong way to split files. You must use the xml way of splitting the
>>files, or give the config files in the same param-value tag seperated by
>>comma.
>>
>>- Navneet
>>Umber Business Solutions Pvt Ltd
>>http://www.umber.biz
>>
>>Franck Lefebure said the following on 25/09/2003 1:09 AM:
>>
>>>Hello,
>>>
>>>My web.xml looks like :
>>>
>>><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/struts-config.xml</param-value>
>>> </init-param>
>>> <init-param>
>>> <param-name>config/news</param-name>
>>> <param-value>/WEB-INF/conf/struts-config-news.xml</param-value>
>>> </init-param>
>>> ...............
>>>
>>>In /WEB-INF/struts-config.xml , I have the following action :
>>>
>>> <global-forwards>
>>> <forward name="error" path="/doError.do"/>
>>> </global-forwards>
>>>
>>> <action-mappings>
>>> <action path = "/doError" scope="request"
>>>type="com.orange.struts.actions.ErrorAction">
>>> <forward name="success" path="/error.jsp" redirect="false"/>
>>> </action>
>>> </action-mappings>
>>>
>>>I want in /WEB-INF/conf/struts-config-news.xml to define global-forward
>>>towards the /doError.do in the main file :
>>>
>>>Something like :
>>>
>>> <global-forwards>
>>> <forward name="error" path="/../doError.do"/>
>>> </global-forwards>
>>>
>>>But, It doesn't work. If I add redirect="true" : <forward name="error"
>>>path="/../doError.do" redirect="true"/>
>>>Then it's ok But I would like to keep my request scope
>>>
>>>An idea ?
>>>Thanks
>>>Franck
>>>
>>>
>>>--
>>>Franck Lefebure
>>>equipe web http://www.orangecaraibe.com
>>>mailto:flefebure@orange.gp
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
--
Thanks
Manish Singla
x73166
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Multi config files and global forward
Posted by Franck Lefebure <fl...@orangecaraibe.com>.
Well,
I learned this way of using muti-config modules in the article
http://www.onjava.com/pub/a/onjava/pub/a/2002/11/06/struts1.html?page=2
I don't have any problem with it but I'm looking for
the smartest way to define a all-modules global-forward
... Or the smartest way to handle exception in a multi-module struts
configuration !
Thanks
--
Franck Lefebure
equipe web http://www.orangecaraibe.com
mailto:flefebure@orange.gp
0590323872
0690569880
----- Original Message -----
From: "Navneet Karnani" <na...@myrealbox.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, September 24, 2003 3:49 PM
Subject: Re: Multi config files and global forward
> Do you intend to make these different modules ? If not, then this is the
> wrong way to split files. You must use the xml way of splitting the
> files, or give the config files in the same param-value tag seperated by
> comma.
>
> - Navneet
> Umber Business Solutions Pvt Ltd
> http://www.umber.biz
>
> Franck Lefebure said the following on 25/09/2003 1:09 AM:
> > Hello,
> >
> > My web.xml looks like :
> >
> > <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/struts-config.xml</param-value>
> > </init-param>
> > <init-param>
> > <param-name>config/news</param-name>
> > <param-value>/WEB-INF/conf/struts-config-news.xml</param-value>
> > </init-param>
> > ...............
> >
> > In /WEB-INF/struts-config.xml , I have the following action :
> >
> > <global-forwards>
> > <forward name="error" path="/doError.do"/>
> > </global-forwards>
> >
> > <action-mappings>
> > <action path = "/doError" scope="request"
> > type="com.orange.struts.actions.ErrorAction">
> > <forward name="success" path="/error.jsp" redirect="false"/>
> > </action>
> > </action-mappings>
> >
> > I want in /WEB-INF/conf/struts-config-news.xml to define global-forward
> > towards the /doError.do in the main file :
> >
> > Something like :
> >
> > <global-forwards>
> > <forward name="error" path="/../doError.do"/>
> > </global-forwards>
> >
> > But, It doesn't work. If I add redirect="true" : <forward name="error"
> > path="/../doError.do" redirect="true"/>
> > Then it's ok But I would like to keep my request scope
> >
> > An idea ?
> > Thanks
> > Franck
> >
> >
> > --
> > Franck Lefebure
> > equipe web http://www.orangecaraibe.com
> > mailto:flefebure@orange.gp
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Multi config files and global forward
Posted by Navneet Karnani <na...@myrealbox.com>.
Do you intend to make these different modules ? If not, then this is the
wrong way to split files. You must use the xml way of splitting the
files, or give the config files in the same param-value tag seperated by
comma.
- Navneet
Umber Business Solutions Pvt Ltd
http://www.umber.biz
Franck Lefebure said the following on 25/09/2003 1:09 AM:
> Hello,
>
> My web.xml looks like :
>
> <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/struts-config.xml</param-value>
> </init-param>
> <init-param>
> <param-name>config/news</param-name>
> <param-value>/WEB-INF/conf/struts-config-news.xml</param-value>
> </init-param>
> ...............
>
> In /WEB-INF/struts-config.xml , I have the following action :
>
> <global-forwards>
> <forward name="error" path="/doError.do"/>
> </global-forwards>
>
> <action-mappings>
> <action path = "/doError" scope="request"
> type="com.orange.struts.actions.ErrorAction">
> <forward name="success" path="/error.jsp" redirect="false"/>
> </action>
> </action-mappings>
>
> I want in /WEB-INF/conf/struts-config-news.xml to define global-forward
> towards the /doError.do in the main file :
>
> Something like :
>
> <global-forwards>
> <forward name="error" path="/../doError.do"/>
> </global-forwards>
>
> But, It doesn't work. If I add redirect="true" : <forward name="error"
> path="/../doError.do" redirect="true"/>
> Then it's ok But I would like to keep my request scope
>
> An idea ?
> Thanks
> Franck
>
>
> --
> Franck Lefebure
> equipe web http://www.orangecaraibe.com
> mailto:flefebure@orange.gp
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Multi config files and global forward
Posted by Duncan Mills <du...@oracle.com>.
You could define a switcher action
<action-mappings>
...
<action path="/switcher" type="org.apache.struts.actions.SwitchAction">
...
</action-mappings>
Then your global forward could use that:
<global-forwards>
<forward name="error" path="/switcher.do?prefix=&page=doError.do"/>
</global-forwards>
Regards
Duncan Mills
----- Original Message -----
From: Franck Lefebure
To: 'Struts Users Mailing List'
Sent: Wednesday, September 24, 2003 8:39 PM
Subject: Multi config files and global forward
Hello,
My web.xml looks like :
<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/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>config/news</param-name>
<param-value>/WEB-INF/conf/struts-config-news.xml</param-value>
</init-param>
...............
In /WEB-INF/struts-config.xml , I have the following action :
<global-forwards>
<forward name="error" path="/doError.do"/>
</global-forwards>
<action-mappings>
<action path = "/doError" scope="request"
type="com.orange.struts.actions.ErrorAction">
<forward name="success" path="/error.jsp" redirect="false"/>
</action>
</action-mappings>
I want in /WEB-INF/conf/struts-config-news.xml to define global-forward
towards the /doError.do in the main file :
Something like :
<global-forwards>
<forward name="error" path="/../doError.do"/>
</global-forwards>
But, It doesn't work. If I add redirect="true" : <forward name="error"
path="/../doError.do" redirect="true"/>
Then it's ok But I would like to keep my request scope
An idea ?
Thanks
Franck
--
Franck Lefebure
equipe web http://www.orangecaraibe.com
mailto:flefebure@orange.gp
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org