• 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

encryption servlet filter

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello;
I am writing a servlet filter that decrypts parameter=value on the way in, and encrypts things on the way out.

I can find lots of things on the internet that say this is what servlet filters are ment to do.

I can get the request parameter/values then encrypt/decrypt the name-value pair.

I am missing how to swap out the old parameter name-value pair for the new parameter name-value pair in the request. I don't want to change my parameters to attributes, because so many other classes depend on getParameter.

Any Suggestions
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are not allowed to set parameters directly, but you can work around this.

Write your own wrapper subclass of HttpServletRequest that overrides the getParameter/s method/s. Your subclassed version can return the encrypted values either on the fly or from a precomputed cache.

reply
    Bookmark Topic Watch Topic
  • New Topic