In the use of Struts multi-module, find some tips and experience, share it with you.
With regard to multi-module configuration, just use different config, struts-config.xml as the default module, struts-config-module.xml as / module configuration
There are many related descriptions on 9CBS.
Module in Struts, in fact, similar to subdirectory in the development of Web programs in the weekday, such as /-root / music / module / ..., the above / MUSIC is used as the module name, then all PATH defaults in Struts-Config-Music /Music/xxx.do
Some tutorials say to put JSP pages in / web-inf, this is a good way, I do this, but unfortunately, Struts's Action tag does not support ContextRelative, only Forward support, if you want to use / xxx .do directly redirect or forward to a page is not going. Because their address is not found relative to /music/web-inf/xxx.jsp.
My suggestion is that the directory below root is consistent with Module. For example / / modulea / moduleb
Although safety is slightly lowered, it is very convenient to use.
General, to write a link, you can write
The default
So what should I do if I want to execute the default module? Oh, it is actually very simple. I started to start my brain, using SwitchAction to solve /Module/switch?prefix=&page=/xxx.do & ....
In fact, a traditional approach can be effectively solved. That is,
The LINK label has three different link methods of Page, HREF, Action. Among them, the Action default points to a PATH, point points to a JSP page, and is also written to the external URL with respect to the Module's HREF.