How can I avoid hard-coding application name in URL's displayed
in the output of a JSP?

For instance, let's us say I have a <APP-NAME>/foo.jsp which needs to
present browser a link to <APP-NAME>/bar.jsp .
In foo.jsp, I can refer to bar.jsp as
   <a href=/APP-NAME/bar.jsp>  Link-to-Bar </a>
But there is a problem - if i change the APP-NAME tomorrow,
I will have to update all references to it.

Instead of hard-coding <APP-NAME> as above, I am looking to do something
like:

<a href=<%=application.getAppName()%>/bar.jsp>  Link-to-Bar </a>

Is there any method on any implicit objects available to JSP that will
let me do something as above ?   Also, how would I do the same in servlet
code?

Thanks in advance,

/Ram

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to