This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
 
Similar Threads
Link to navigate to another JSP from a JSP page containing JSF tags
relative and absolute path
software required to run JSP and Servlets
file chooser
Referring to variables set in a file in one War file to another War file