There doesn't appear to be any way to cause the URL in a <form:form>
tag's "action" parameter to be rewritten using the webapp's context
path. As a result, if I use an action="x", it directs the action to
x in the current directory, which in my case isn't what I want. If I
use an action="/x", it directs the action to the x in the web server's
root directory - not the root of my webapp context, which is what I
Note the use of single quotes on the attribute, to avoid problems with the
double quotes used by Java.
While I'm still learning the Struts' tag libraries, I believe that this
is the way to do it. I belive that scriplets parse before taglibs, so
the result of <%= request.getContextPath() %> will be put into the action
attribute before the form:form is parsed. (Please, somebody correct me
if I'm wrong on that point.)
This works because <img> is not a JSP tag, but you might want to recast it in
the form that computes the entire expression, so that you can train your fingers
to type expressions like this one way in all circumstances.