James Howe wrote:

> I'm sort of confused as to where the system thinks it is after
> performing a forward action.

This is one of the interesting wrinkles to using a RequestDispatcher (as Struts
does to implement the forwarding).  Because the client browser has no clue that
the forwarding took place, so by default relative URLs will be resolved based
on the URL of the action you submitted to (i.e.  something like
http://localhost:8080/myapp/action.do) rather than where the JSP page itself
is.

One approach that works, as you pointed out, was putting everything at the top
level of the URL hierarchy within your webapp.  Another option is to include
the

    <html:base/>

tag in the <head> section of your page.  This will generate a <base href="...">
element in the generated page, which will make relative addresses resolve
against the URL of the JSP page itself, not the action that forwarded to it.

Craig


Reply via email to