Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • When the action is called, its setYourName() setter is called with the contents of the form field named yourName.
  • After the action has been called (which is when its execute() method returns), WebWork has two options. If ERROR is returned, WebWork will return page03-error.jsp; if SUCCESS, page03-success.jsp. Just as in the last lesson, the <ww:property> tag calls the action's getter (in this case, getYourName()).

...

An html form with data, without getters or setters

For the form field named "yourName" in the previous lesson, we also had to create the getters and setters getYourName() and setYourName() in the action, as well as the private variable yourName. With dozens of forms and hundreds of form fields, you'll be typing thousands of getters and setters. That can get old fast. In this lesson, we'll repeat the last lesson, but without any of that extra typing.

...

We haven't covered how to handle radio buttons, checkboxes, and other strange html form fields. That involves dealing with the fact that every entry in the parameters Map is a String[]. We'll cover this in a later lesson.Lesson 2 - An html form with no data | Lesson 4 - An html form with data, without getters or setters