This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
We need to hardcode the jsp paths into the struts-config.xml. But what about, say, we want to create a subdirectory and move some jsps into it. In this case, we need to modify all the affected jsp path one by one. Is there a simpler and more reliable way to change the jsp path?
Do you mean this is all Struts has to offer? That is, allowing us to move the path into a few struts-config-xxx.xml files instead of hard coding them in the servlets so that they are find/replace friendly? Is it possible in Struts to take a further step by encapsulating the jsp's paths into some sort of constants so that we don't have to bother about the directory structure at the very beginning.
Joined: Feb 15, 2005
Struts uses hard-coded jsp paths in the struts-config.xml file. That's the way it works.
If that's not to your liking, I'd suggest you write an extension to Struts that does it the way you think it should, and then submit your extension as a suggested inclusion into the next version of Sruts.
Struts is open-source software that is created by volunteer developers. If there's something you don't like, all you can do is make suggestions and offer your help to make it better.