Subject: Configuring sub-applications
From: Bill Wohler <[EMAIL PROTECTED]>
===
Let's say I have the following goals:
1. I want the following URLs:
http://host/app/subapp1/someaction
http://host/app/subapp2/someaction
2. I want the subapps to have their own action namespace.
3. I want to break up the configurations (struts-config.xml and
tile-defs.xml) for the subapps. This goal is up for negotiation if
necessary.
I thought my web.xml might look like this:
<web-app>
...
<servlet>
<servlet-name>subapp1</servlet-name>
<servlet-class>
org.apache.struts.tiles.ActionComponentServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/docroot/subapp1/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>definitions-config</param-name>
<param-value>/docroot/subapp1/tile-defs.xml</param-value>
</init-param>
...
<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
<servlet-name>subapp2</servlet-name>
<servlet-class>
org.apache.struts.tiles.ActionComponentServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/docroot/subapp2/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>definitions-config</param-name>
<param-value>/docroot/subapp2/tile-defs.xml</param-value>
</init-param>
...
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>subapp1</servlet-name>
<url-pattern>/subapp1/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>subapp2</servlet-name>
<url-pattern>/subapp2/*</url-pattern>
</servlet-mapping>
...
</web-app>
First, is the correct way to achieve my goals? It might not be,
because unfortunately, I'm getting this message for all URLs in
subapp1:
The request sent by the client was syntactically incorrect
(Invalid path /someaction was requested).
And for URLs in subapp2:
The requested resource (/subapp2/someaction) is not available.
However, if I add the following to /index.jsp and view that, I get
a view of the page:
<tiles:insert definition="subapp1.page1" />
However, the following errors appear in the page:
[ServletException in:/docroot/subapp1/someaction/content.jsp]
Cannot retrieve mapping for action /someotheraction
And if I put the following in index.jsp:
<tiles:insert definition="subapp2.page1" />
I get this:
javax.servlet.ServletException: Error - Tag Insert : Can't get
definition 'subapp2.page2 '. Check if this name exist in
definitions factory.
If I rip out the servlet and servlet-mapping stanzas for subapp2,
then subapp1 works just fine.
The Tomcat 4.0.2 log files offer no additional information.
I'd appreciate any suggestions you might have. I searched but
couldn't find any examples like this.
--
Bill Wohler <[EMAIL PROTECTED]> http://www.newt.com/wohler/ GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and mh-e. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>