File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Clear Form Bean Values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Clear Form Bean Values" Watch "Clear Form Bean Values" New topic

Clear Form Bean Values

Kalaiselvan Selvamani
Ranch Hand

Joined: Sep 10, 2001
Posts: 32
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())) {
} else {
HttpSession session = request.getSession();
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
Lakshmanan NS

Joined: Apr 02, 2003
Posts: 20
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.
I agree. Here's the link:
subject: Clear Form Bean Values
It's not a secret anymore!