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 How to send hidden variable in sendRedirect(url) method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

How to send hidden variable in sendRedirect(url) method

rev sam
Greenhorn

Joined: May 26, 2008
Posts: 18
I am sending url using sendRedirect method along with some parameters.

I dont want these parameters to be visible in clienturl.How to hide these parameters? I am new to jave.please help me in getting this.

Say for EX: http://localhost/manager/test.php?test=rev

I dont want the name "test" to be visible.How to hide it and send back to url(using sendRedirect()) method
K Kiran Kumar
Ranch Hand

Joined: Jan 04, 2006
Posts: 109
Hi Sam,
Instead of appending the variables in the URL, better save them in a session and retrieve the same when you need them. Here your privacy is maintained while redirecting. You can also use removeAttribute() method to delete the unwanted attributes.
Regards,
Kiran.
[ May 27, 2008: Message edited by: K Kiran Kumar ]
rev sam
Greenhorn

Joined: May 26, 2008
Posts: 18
we cannot use session here. we have some plan to access this url using webservices
cortin flaneir
Greenhorn

Joined: May 26, 2008
Posts: 13
if you use servlet then set this value in servletcontext and then retrive value whenever you want.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56207
    
  13

Please continue any discussion in the original post on this topic.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to send hidden variable in sendRedirect(url) method
 
Similar Threads
Url hiding
modifying URL query string
URL Parameters
sendRedirect fails to post data along with url if the data is too large
hide parameters on url jsp