Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sending a parameter to a different URL(sendRedirect) but not by appending it to the URL

 
Nitin Bhardwaj
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dear Friends,

I want to redirect to some other URL using sendRedirect() method. Also I want to send a parameter(some sort of ID) without appending it to the URL. What are the ways by which I can send this parameter so that it doesn't appear in the URL...address bar(as in case of GET)?

Thanks & Regards,
Nitin

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if the redirected URL lies in same web application ,then set your param values into the session
 
Nitin Bhardwaj
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh !! Sorry I forgot to tell that URL is not in the same application. I am redirecting to a completely different Server.

Regards,
Nitin
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nitin,

Then i am not sure, you need to append the parameter values into the URL(QuryString) . may i know that why you dont like this approach?
 
Nitin Bhardwaj
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

As an approach there is no problem !!
I was just exploring a way in which we could send this parameter without showing it up in the Address Bar (in URL's query string).
Thanks & Regards,
Nitin
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitin Bhardwaj wrote:
I was just exploring a way in which we could send this parameter without showing it up in the Address Bar (in URL's query string).


if you dont want to show the parameter values to the user,then encrypt these values .MD5 is a good encrypt mechanism
 
Nitin Bhardwaj
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep that is the last option !!
What I meant was that, I was exploring a way to do that without appending anything to the query string...just in case there is something that I don't know !!

Thanks & Regards,
Nitin
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In basic terms, you want to use POST instead of GET?

You can use java.net.URLConnection or, a bit more enhanced, the Apache Commons HttpClient for this. You only need to handle the response yourself. If this isn´t an option, then live with GET.
 
I do some of my very best work in water. Like this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!