• 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

Clear Form Bean Values

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai All
I want to clear formbean values. But i couldnt able to clear the values. The request values are not cleared.
if (mapping.getAttribute() != null) {
if ("request".equals(mapping.getScope())) {
request.removeAttribute(mapping.getAttribute());
} else {
HttpSession session = request.getSession();
session.removeAttribute(mapping.getAttribute());
}
}
This only cleared the request attribute not request parameter. How can we clear our request parameter values. If get the request.getParameterNames() i got all the values setted before the screen. Before moving to another screen i have to clear all the formbean values.
Thanx in Advance
Kalaiselvan.S
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you submit a form from a browser, the underlying HTML framework is that all the variables in the form goes into the request as parameters. Struts takes these values and set them into the corresponding Form and put the form into either request or session scope. So, struts naturally provides ways to clear the Form objects as well as the attritutes in the form. But, clearing the parameters in the request itself it not available under the servlet framework and it has nothing to do with struts. The request will get cleared automatically when the control goes back to the browser.
Lakshman
 
reply
    Bookmark Topic Watch Topic
  • New Topic