Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sean cee
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mr.Brogden,
You are legend!!
Thanks again!!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic