wood burning stoves*
The moose likes Servlets and the fly likes RequestDispatcher 's forward method take you to a page but no IMG.! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDispatcher Watch "RequestDispatcher New topic
Author

RequestDispatcher 's forward method take you to a page but no IMG.!

sean cee
Ranch Hand

Joined: Oct 24, 2000
Posts: 115
Hi,
a.html -> b.jsp -> validate.java
when I enter b.jsp from a.html by clicking a link i can see a IMG that I included.
but when I click on a button that calls validate.java it will validate some info. and depending on the validation it may call b.jsp again to prompt the user to corrent things..
but when it does that the IMG is not seen !!
I don't know why...
also is there a better approach to achive the above functionality? some kind of methos that has the same effect as a user pushing BACK button so that all the form data will still be there automatically...
Thanks heaps


Sean <br />SCJP2, SCJP2p1.4, SCWCD
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
I am betting that your image tag was not an absolute URL but a relative one. When the server serves a servlet, it looks to the browser like it is coming from a /servlet directory so thats where the browser requests the image from.
The solution: Use a <base> tag in the <head> area of the page to point the browser to the directory for images and other resources (as applet classes.)
Bill

------------------
author of:
sean cee
Ranch Hand

Joined: Oct 24, 2000
Posts: 115
Mr.Brogden,
You are legend!!
Thanks again!!

 
jQuery in Action, 2nd edition
 
subject: RequestDispatcher 's forward method take you to a page but no IMG.!