wood burning stoves 2.0*
The moose likes Struts and the fly likes how this happeded? not expected but pleasant! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how this happeded? not expected but pleasant!" Watch "how this happeded? not expected but pleasant!" New topic
Author

how this happeded? not expected but pleasant!

Ningfeng Xu
Greenhorn

Joined: Jan 22, 2002
Posts: 18
I submit a filled-up form, like login.jsp, to the action, which checks to see whether the name/password pair represents a valid user. In case it is not, the action will forward to the same page, login.jsp. But suprisingly, the form is still filled up, with original user input. How this happened? I actually didn't expect.


SCJP2
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
That's one of the cool things about Struts and the <html:text> and other <html:xxx> tags. They take their values from the ActionForm bean and populate the ActionForm when submitted. This means that if a page is returned because of validation errors, the fields will retain their values.


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how this happeded? not expected but pleasant!