• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to encrypt a parameter which is passing with URL?

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic