Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

what is the location.href equivalent ??  RSS feed

 
Brian Percival
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple q, but kind of new to java web technologies, what is the javascript location.href equivalent in servlets/jsps? .sendRedirect is not I would think because it makes available the request and response objects the same ones as on the current servlet. What do I have to do if I processed a request in my servlet and then want the user to redirect to a different page? or is it still .sendRedirect()? If we do that the final page would still have available to it the original request values? I dont want that. what is the solution? Am I confusing myself?

Brian
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Percival:
Simple q,



In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
UseRealWords

Abbreviations such as "u" or "ur" in
place of "you" and "you are" or "you're" confound language translation software making
it hard for our non-English speaking members to read your posts.
"plz" is not a word in the English language.

Again, welcome to JavaRanch and good luck with your question.
-Ben
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, sendRedirect does nothing to retain the original request objects.
It works by sending a 30x response code and a Location header to the browser.
Once received, the browser uses these to make a brand new request; just as it would if you were to call location.href.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!