aspose file tools*
The moose likes Struts and the fly likes Hardcoded JSP Path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Hardcoded JSP Path" Watch "Hardcoded JSP Path" New topic
Author

Hardcoded JSP Path

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
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?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Yes. Use your text editor's find-and-replace function.


Merrill
Consultant, Sima Solutions
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
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.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hardcoded JSP Path