This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


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
Author

how can i implement multiple controlers in struts?

zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416
hello
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: 16098
    
  21

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
Greenhorn

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?
 
GeeCON Prague 2014
 
subject: how can i implement multiple controlers in struts?