Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding Attributes to Servlet Link?

 
Kimberley Jones
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a web-based app. I am trying to avoid showing my parameters in the address bar. Is there any way to link to a servlet using <a href="Example"> and have Example pick up some parameters?

Is submitting a form the only way a servlet can get parameters without showing your params in the address bar?

Thanks in advance for any help/ideas.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah we can't say like,

<a href="SomeLogger" method="post"> logger </a>

hope somebody knows and comes up with a solution.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
couldn't we use a hidden field. check that field on the server side and then use forward() or sendRedirect(). but ofcourse this is the other way out.
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kimberley,

If you don't mind using JavaScript you could always submit a form with code like the following:


If you want to make your URL parameters inaccessible you need to avoid using HTTP GET.

Jules
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you absolutely have to use GET - consider encrypting the added attributes - they will be visible but not understandable. Look at some of the SPAM email messages you get - if they contain URLs with long chunks of gibberish - that may be encrypted attributes.
Bill
 
Kimberley Jones
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will look into both the form and the encrypted attributes ideas...I feel like I've probably seen a lot of encrypted attributes at e-mail and e-commerce sites.

Thanks so much for your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic