Originally posted by Thambi Rajah:
Since A.jsp is a JSP page, this page will be translated into a generated Servlet, A$jsp.java.
Will this generated Servlet understand / as Web Application Root directory?
Within the JSP you mark the java-code with <% and %> and all code within those 'tags' will be integrated and executed in the generated Servlet. In this part you can refer to / as webapp root e.g. if you want to read from a property-file or something.
The HTML-Part of your code (outside of <% and %> ;) will be incorporated into the output of the servlet and sent to the browser "as is". Same applies to the parts you add with "out.print()" to the output-Stream of the Servlet.
Everything that is sent to the browser (basically what you see if you look at the page source) is plain HTML, no matter how it has been generated.
And any path-information you see there (in the page source) is treated relative to the location of the document.
I hope I was able to explain it clear enough.
The most important difference is: what is the
java part and what is the HTML-part. Any path-references in the HTML-part (even if it has been generated from the java part) are treated as if it would be a normal HTML-Document.
sl
Hartmut
[ September 13, 2002: Message edited by: Hartmut Ludwig ]