File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 12675
    
    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:


Java Resources at www.wbrogden.com
sean cee
Ranch Hand

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

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: RequestDispatcher 's forward method take you to a page but no IMG.!
 
Similar Threads
simple problem
Data stored without notice
display data in same jsp
Problem caused by pressing the 'BACK' button on the broswer
Popup windows with dynamic content using struts