wood burning stoves*
The moose likes Struts and the fly likes how can i implement multiple controlers in struts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how can i implement multiple controlers in struts?" Watch "how can i implement multiple controlers in struts?" New topic

how can i implement multiple controlers in struts?

zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
in struts,we use one servlet controler and config it in struts-config file,but in my program,i want separate controler for each set of related functionality,how can i do?
thanks for any helps!
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950

I don't really recommend that unless you have a truly complex website with very distinct differences in how the fundamental dispatching is being done or you have a compelling reason to keep several independent struts-config.xml files (which basically means that you're running multiple webapps).
You specify the Struts controller servlet in the web.xml file. Also in web.xml you specify the URL mappings. So you can run multiple servlets -- or multiple instances of the standard Struts servlet -- just by adding mappings.

Customer surveys are for companies who didn't pay proper attention to begin with.
Elizabeth Reynolds

Joined: Mar 31, 2002
Posts: 24
Couldn't you just extend ActionServlet with a different servlet name for each web app and then pass a different config object in the init parameters for each servlet?
I agree. Here's the link: http://aspose.com/file-tools
subject: how can i implement multiple controlers in struts?
Similar Threads
is Validator can be configured as Module config ?
call java funtion in jstl
question for h:inputText with struts tile 1.1
design with spring+struts
Why Jakarta Struts?