Module using struts and more, find some small skills and experience to share with you.
On the multi-module configuration is not said, just use a different config,
struts-config.xml as the default module, struts-config-module.xml as / module configuration
CSDN on many related instructions.
struts in the module, in effect, similar to the normal development of web programs in a subdirectory
As
/ - Root
/ Music
/ Module
/ ...
Such as above / music as a module name
Then the struts-config-music all of the default path is / music / xxx.do
Some tutorial jsp page that should be placed in / web-inf, this is a good way,
At first I do the same, unfortunately, struts in action tag does not support contextRelative, only the forward support
So, if you want to use the / xxx.do redirect or forward directly to a page that does not work.
Because they address relative to the / music / web-inf / xxx.jsp so can not find.
My advice is, root directory to and following the same module.
Such as
/
/ ModuleA
/ ModuleB
Although the safety of some lower, but the ease of use.
In general, write a link, you can write
His advantage is built-in support module, do not need to write your own. Do, which can make you. Do
Any changes to the other without affecting the program is running. For example,. Jspa, pretend webwork
The default
In this page, all the link are converted to relative to / module as
So, if the default module to perform the action how to do? Hey, is very simple. I started when their brains used switchAction to address / module / switch? Prefix = & page = / xxx.do &.... more trouble
In fact, a traditional way to solve. That
Can return to the level of module in. I started to really did not expect.
link labels page, href, action links three different ways.
Which, action the default point to a path, page point to a jsp page, the href is relative to the module can write an external url.