Struts does not currently support multiple controllers in the same web app
(although there is an outstanding enhancement request in the bug tracking
system for just this feature).  The problem you are running into is that
all of the mappings are stored in a single servlet context
attribute.  There is a similar situation with the lists of form beans, the
data sources, and (perhaps most importantly) the application resources.

Implementing this feature will require enough internal changes that it's
not going to be possible in the Struts 1.0 time frame (targeted for final
release this Friday).  However, it will be on the 1.1 TODO list.

Craig McClanahan


On Mon, 11 Jun 2001, Eric W. Sullender wrote:

> Hello,
> 
> I've been trying to figure out why this is happening and have had no
> luck, so I figured maybe someone here could help.  I don't know if
> this is a bug, or if I just don't understand the correct application
> framework, etc.
> 
> I have two servlets defined in the web.xml file (servlet1 and
> servlet1) of class types servletclass1 and servletclass2. Each one has
> the init-param 'config' set to the same 'stuts-config.xml'.  Each
> servlet has a different mapping (*.do1, *.do2).  In the
> stuts-config.xml file I have two action paths defined (/path1 and
> /path2) with types actionclass1 and actionclass2. The requests are
> only for path1.do1 and path2.do2, never path1.do2.
> 
> When I load this, both mappings get mapped to both servlets:
> 
> Call
> package.ServletClass1.addServletMapping(servlet1/java.lang.String,*.do
> 1/java.lang.String)
> Call
> package.ServletClass1.addServletMapping(servlet2/java.lang.String,*.do
> 2/java.lang.String)
> 
> then later on....
> 
> Call
> package.ServletClass2.addServletMapping(servlet1/java.lang.String,*.do
> 1/java.lang.String)
> Call
> package.ServletClass2.addServletMapping(servlet2/java.lang.String,*.do
> 2/java.lang.String)
> 
> Any ideas?  Should I just define a seperate stuts-config file?
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 

Reply via email to