"Ray Tayek" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At 01:04 PM 3/3/03 -0500, you wrote: > >Ray Tayek wrote: > >>hi, i am forwarding a request to a static html page that has some > >>pictures included using <IMG SRC="images/help1.jpeg" ...> and using > >>request.getRequestDispatcher("/help.html").forward(request,response);. > >>the static html file file comes back sans images. ... > > > >According to SRV.8.4 of the Servlet 2.3 spec, "The Forward Method": > > > >"The path elements of the request object exposed to the target servlet > >must reflect the path used to obtain the RequestDispatcher. The only > >exception to this is if the RequestDispatcher ... > > > >Are you using "getNamedDispatcher"? ... > > i was using getRequestDispatcher(). but i have changed that to use redirect > (which works, but may cause me some problems later with session - ...
Another way to go is to use absolute paths to your image files (e.g. <img src="/feb/images/help1.jpeg">) and continue to use rd.forward. At the risk of breaking some very old browsers, you could also use the <base href="/feb/"> html tag and keep your relative image paths.
i could do that and may if i need to go back to using forward.
> > i found some sort of answer in jason hunters book (2nd edition) on page > 375. something about tomcat and relative links being broken ...
The problem is that the browser issues a seperate request for the image files as it is parsing the html. Since the browser has no way of knowing that the request is the result of a 'forward', it resolves the relative URL (i.e. "images/help1.jpeg") against the URL that it made the request for. ...
got it!
thanks for the info.
--- ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work vice chair orange county java users group http://www.ocjug.org/ hate spam? http://samspade.org/ssw/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
