• 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 clear request parameters

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

I am using DynaValdiatorForm.
I want to clear all the request attributes (I am interested in removing only 1 property)i.e. form values to be cleared before I forward it to jsp page.

I have tried
myForm.set("userId", null);
httpRequest.removeAttribute("userId");

But it seems both of them are not working.

The reason I want to do that because forward takes me to jsp page where I am setting userId to <html:link userId="${param.userId}" (JSTL tag)
and in this particular case I do not want to set the value...


Please help.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not think that you can change or remove a request parameter. As you have seen, changing values on your form does not affect the values on the request. Also, "attributes" and "parameters" are different things so calling removeAttribute will not remove a parameter.

As far as your problem goes, maybe you could use the value from your form instead of using the request parameter.

- Brent
 
A wop bop a lu bop a womp bam boom! Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic