• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:forward  RSS feed

 
mohan kannan
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
is this one allowed in jsp
<jsp:forward page="somepic.gif" />
I am required to use this in my code to redirect to an html page in this way
The same is allowed in asp programming ie
response.redirect ("somepic.gif")
thanks
mohan
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<jsp:forward page="somepic.gif" />

somepic.gif ain't no HTML page. But that's not a problem, it should work. Doesn't it work for you?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
forward is not the same as redirect.
forward retains the same request and response, in effect the client is asking for content A and you are deciding to return content B. I imagine forwarding an image should work as long as you have set the correct content-type.
redirect (or sendRedirect) returns a reply to the client telling them to ask for a differnt piece of content. ie, the client asks for content A, you send them a message telling them to look at content B instead and the browser automatically loads the new content.
Hope this clears it up,
Dave.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!