Hi,
If your trying to do what I think that you are doing (ie have links to other
JSP's in your App's Directory structure)
Then why not use relative links?
If you know for instance that the JSP being shown is at
http://Your-Server/APP-NAME/jsp-dir/bar.jsp
and you want to link to foo.jsp which is at
http://Your-Server/APP-NAME/jsp-dir/foo.jsp
then you could use a link like
<a href=./foo.jsp> Link-to-Foo </a>
If you wanted a link to test.html which is at
http://Your-Server/APP-NAME/html-dir/test.html
then you could use a link like
<a href=../html-dir/test.html> Link-to-Test </a>
As long as you don't try to go up past the document root of your web server then
you should be O.K.
Karl
Ramkumar_Gopalaswamy wrote:
> 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
===========================================================================
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