• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Adding Attributes to Servlet Link?

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic