You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Túlio Tadeu (Matriz - CPD)" <tu...@prevcaixa.com.br> on 2002/09/23 17:40:25 UTC
Struts 1.1 beta 2 and sub-applications
(excuse me I don't know English very well)
Hello,
I am using Struts 1.1 (beta) and I have a problem:
1. I created an application <default> configured by the file
<struts-config.xml>
2. I created a sub-application <subapp1> configured by the file
<struts-config-subapp1.xml>
3. The files JSP of the application <default> they are accessible in
http://<host>:<port>/application/
4. The files JSP of the sub-application <subapp1> they are accessible in
http://<host>:<port>/application/subapp1
5. In the file <struts-config-subapp1.xml> I created one Action Mapping
<welcome> that it is a static redirect for a file JSP <file.jsp>
6. Also in the file <struts-config-subapp1.xml> I pointed Message Resources
for com.aplication.ApplicationResources
The problem:
- Accessing http://<host>:<port>/application/subapp1/welcome.do no I have
problem some and the <file.jsp> it is carried
usually with all the configurations of ApplicationResources, ActionMappings
and FormBeans
- However, in case I make a direct call
http://<host>:<port>/application/subapp1/file.jsp I receive the following
message:
#javax.servlet.ServletException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
- There I "transferred" the configuration of ApplicationResources of the
file <struts-config-subapp1.xml> for <struts-config.xml>, I restarted the
application and I made the same call:
http://<host>:<port>/application/subapp1/file.jsp the
I wander this time was the following:
#javax.servlet.ServletException: Cannot retrieve mapping goes action / to
associate
- I believe that I marry I "transfer" mine ActionMappings of the file
<struts-config-subapp1.xml> for the file <struts-config.xml> the new error
message will be related with FormBean that it is still configured in
<struts-config.xml>
The great subject is: because accessing him/it directly I file <file.jsp>
the configurations of <struts-config-subapp1.xml> they don't have validity
and accessing through the action <welcome.do> do they start to work?
Somebody already went by this problem?
--
Túlio Tadeu
Analista de Sistemas
PREVCAIXA - Caixa de Previdência e Assistência
Tel: (31) 3226-8707 - Ramal: 101
http://www.prevcaixa.com.br/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Struts 1.1 beta 2 and sub-applications
Posted by Eddie Bush <ek...@swbell.net>.
Hi Túlio
Túlio Tadeu (Matriz - CPD) wrote:
>(excuse me I don't know English very well)
>
>Hello,
>
>I am using Struts 1.1 (beta) and I have a problem:
>
>1. I created an application <default> configured by the file
><struts-config.xml>
>2. I created a sub-application <subapp1> configured by the file
><struts-config-subapp1.xml>
>3. The files JSP of the application <default> they are accessible in
>http://<host>:<port>/application/
>4. The files JSP of the sub-application <subapp1> they are accessible in
>http://<host>:<port>/application/subapp1
>5. In the file <struts-config-subapp1.xml> I created one Action Mapping
><welcome> that it is a static redirect for a file JSP <file.jsp>
>6. Also in the file <struts-config-subapp1.xml> I pointed Message Resources
>for com.aplication.ApplicationResources
>
>The problem:
>
>- Accessing http://<host>:<port>/application/subapp1/welcome.do no I have
>problem some and the <file.jsp> it is carried
>usually with all the configurations of ApplicationResources, ActionMappings
>and FormBeans
>
I don't think I understand :-(
>- However, in case I make a direct call
>http://<host>:<port>/application/subapp1/file.jsp I receive the following
>message:
>#javax.servlet.ServletException: Cannot find message resources under key
>org.apache.struts.action.MESSAGE
>
If you go directly to the JSP, you do not involve the controller servlet
in the request. The controller servlet is what makes your
sub-application configuration available in the request. If you don't
involve the controller servlet, it won't be there. Solution: Use
org.apache.struts.actions.ForwardAction for all simple forwards and
specify the page you want to view as the 'parameter=' attribute for the
action.
>- There I "transferred" the configuration of ApplicationResources of the
>file <struts-config-subapp1.xml> for <struts-config.xml>, I restarted the
>application and I made the same call:
>http://<host>:<port>/application/subapp1/file.jsp the
>I wander this time was the following:
>#javax.servlet.ServletException: Cannot retrieve mapping goes action / to
>associate
>
Same problem as above. You must involve the controller servlet (call an
action instead of referencing pages directly).
>- I believe that I marry I "transfer" mine ActionMappings of the file
><struts-config-subapp1.xml> for the file <struts-config.xml> the new error
>message will be related with FormBean that it is still configured in
><struts-config.xml>
>
Sorry, I don't think I understand :-(
>The great subject is: because accessing him/it directly I file <file.jsp>
>the configurations of <struts-config-subapp1.xml> they don't have validity
>and accessing through the action <welcome.do> do they start to work?
>
Right! If I understand what you said correctly, you are exactly right!
>Somebody already went by this problem?
>
>--
>Túlio Tadeu
>Analista de Sistemas
>
>PREVCAIXA - Caixa de Previdência e Assistência
>Tel: (31) 3226-8707 - Ramal: 101
>http://www.prevcaixa.com.br/
>
--
Eddie Bush
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>