Matthew Hughes wrote:
...[large section removed]...

What is the best solution?  Put a <base href=""> tag on every page, or
insert the context path before every link, image source, frame source.
 OR I have an idea of using JavaScript to just parse through all the
links, image sources, and prepend the context path.  Anyone who has
had trouble with relative links and links breaking when you move stuff
around, I'd be happy to heard your thoughts on this.
I have developed a project of similar size in the past. I recommend the following (apply in sequence):
1. Replace ALL <a href="..."> tags with <struts-html:link> tags. This will allow you to use HREFs relative to webapp root (context) only. See Struts Taglib documentation for further details.
2. Replace ALL links going to JSPs with links going to actions which forward requests to configured JSPs in turn. The Action code is trivial:
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception{
return mapping.findForward("success");
}
You just need to configure a separate action for each distinct link.
This will allow you to keep all JSP references in one file.
3. It would be better to move JSPs under WEB-INF folder for security reasons.


--
Illya Kysil, software developer
Java/Delphi/C/C++/C#/Forth/Assembler
-------------------------------------------------------------------------
Shakespeare / King Henry IV
GLENDOWER  I can call spirits from the vasty deep.
HOTSPUR    Why, so can I, or so can any man;
           But will they come when you do call for them?


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to