Versions Compared

Key

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

The example code for this tutorial, preparable_interface, is available for checkout from at https://svngithub.apache.org/repos/asf/struts/sandbox/trunk/struts2examples/com/apache/struts-examples.

Introduction

Often the data used to populate a form control is dynamically generated, perhaps from a database. When the user submits the form, the Struts 2 validation interceptor attempts to validate the user's form input. If validation fails the Struts 2 framework returns the value "input" but the "input" action is not re-executed. Rather the view associated with the "input" result is rendered to the user. Usually this view is the page that displayed the original form.

...

Code Block
java
titleEditAction.java prepare Method
java

		
   carModelsAvailable = carModelsService.getCarModels() ;
		
   setPersonBean( editService.getPerson() );

...