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!
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.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
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?
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
a bit of art, as a gift, that will fit in a stocking