• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to encrypt a parameter which is passing with URL?  RSS feed

 
Venki Ananth
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
This is my jsp code.
<%
String id="cnd001";
out.println("<a href='ViewProfile2?applicantid=" + id+ "'>"+ id+ "</a>");
%>
When i run this jsp code it will show the direct URL with the parameter like this "http://localhost:8080/MyProject/ViewProfile2?applicantid=cnd001".
But i dont want to show my parameter (applicantid) to the user. How can i hide or encrypt that parameter! I used "first.jsp" and servlet "ViewProfile2".

Thanks in advance!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using out.print to create HTMl markup? That's insane. The whole purpose of a JSP is so that you can put HTML markup directly in template text.

To answer your question, you can submit a form with a method of POST with the parameter in a hidden element to prevent it from appearing on the URL.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!