File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clear Form Bean Values

 
Kalaiselvan Selvamani
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Lakshmanan NS
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic