To answer my own question, it
is a very bad practice to hard-code the context path into URLs. But you can easily get around that.
Tactic 1: Form URLs using something like:
<link href="${pageContext.request.contextPath}/styles/mystyles.css" ...
Tactic 2: Dynamically generate a base tag:
<base href="${pageContext.request.contextPath}"/>
from which you specify relative URLs.
Note that the above examples use
JSP 2.0 features. They are also feasible in JSP 1.2 using scriplet expresssions.
[ July 21, 2004: Message edited by: Bear Bibeault ]