• Post Reply Bookmark Topic Watch Topic
  • New Topic

maintain/organize jsp links w/o having to edit all the pages linking to  RSS feed

 
Tom Kata
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am looking for methods (or even products) that I can use to maintain the organization of the html/jsp pages I link in
<%@ include file="somefile.jsp" %>
directive such that if the name or location of "somefile.jsp" changes, all I'd need to do is change it in some file-maintenance file. For example, I was thinking of creating an xml file where tags would be given a generic name that references back to different files (eg. <header>, <footer>, <content> ; then if I need to change the location of the file, all I need to do is change the value of the appropriate xml tag to the new filename or location, and then the jsp container (I use tomcat4) would be able to compile the "include file" directive to the new one while preventing unnecessary, time-consuming edits in the jsp page(s).
I would extremely appreciate any suggestion on methods, implementations, or even products that would do this kind of file maintenance, as I have searched all over the web and have yet to come close to anything that would do this.
Thanks so much in advance.
 
Jeya Balaji
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tom,
I am also looking for a good way of hiding the details.
Struts kind of framework should help us. Yet to find time to try it out; probably for the next project I will use it.
Now I am using the following method :
<a href='controller?page=home'>Home</a>
ie, using a controller servlet which will accept page as a parameter and forward to that page.
The controller servlet can read a property file to map the page name with the page url.
I am working out to something more simple, like :
defining <servlet-mapping> in web.xml such a way that *.html (or *.jsp *.do) will be passed to controller servlet. Then controller can identify the requested page and transfer control to that page.
In this setup, the link will be
<a href='home.html'>Home</a>
Here even the 'controller' will be removed. Have to see if this idea will work.
Regards,
Balaji
 
Scott Duncan
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We did use xml files to configure stuff like links on jsps and such but a better way of doing things is using struts and tiles, which we are now doing.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!