Two Laptop Bag*
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: 15957
    
  19

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?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how can i implement multiple controlers in struts?
 
Similar Threads
Why Jakarta Struts?
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