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

JSP  RSS feed

 
velgapudi suresh
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In my jsp i have a action for a url so i dont want to view the url values in a Address.

a href="ROB.jsp?command=Edit&id=<%=optbean.getid()%>&optid=<%=optbean.getOptid()%>

How to encrypt the values in url .

Thanks
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check java.net.URLEncoder class. It has a static method "encode".
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my jsp i have a action for a url so i dont want to view the url values in a Address

Is this for security reasons ? You should not post them in the url then.

Note that the above solution using URLEncoder will not encrypt the values, because the alphanumeric characters "a" through "z", "A" through "Z" and "0" through "9" remain the same.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

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:
UseAMeaningfulSubjectLine

This forum is dedicated to JSP so we're already aware that this is a JSP question. Use the subject line to give us an brief overview of your question.
"Hiding request parameters" or something similar would be much more descritive than "JSP".

Thanks and good-luck with your question.
-Ben
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!