Expert Spring MVC and Web Flow
CustomDateEditor firstDateEditor = new CustomDateEditor(firstDateFormat, true); CustomDateEditor secondDateEditor = new CustomDa ...
this.prefix = prefix; } public String getSuffix() { return suffix; } public void setSuffix(String suffix) { this.suffix = suffix ...
public void setAsText(String text) throws IllegalArgumentException { if (! StringUtils.hasText(text)) { throw new IllegalArgumen ...
expected = new PhoneNumber(); expected.setAreaCode("222"); expected.setPrefix("333"); expected.setSuffix("4444"); } public void ...
To allow certain properties, simply call the setAllowedFields()method with a full list of all properties to be considered for bi ...
Errors that apply to the entire object being bound to are instances of org.springframework. validation.ObjectErrorand are create ...
Listing 6-38.Type Conversion Error Test protected void setUp() throws Exception { bean = new MultiTypeCommandBean(); binder = ne ...
You can also bind to properties of objects that live inside collections, such as Sets, Insert arrays, after Lists, and Maps. You ...
Table 6-2.SimpleFormController Properties Property Name Default Description Found In formView null The name of the view that Sim ...
This controller has a complex work flow, and we will break it down into its core compo- nents. Then, we will show you the best e ...
controller will then consider this request as the first of two requests (the second being the actual form submission). It will c ...
If you’ve made it this far, the Controllerwill assemble the full model with the form object, any possible errors from potential ...
With the form bean created, and the DataBindercreated with custom PropertyEditors regis- tered, the request parameters are now b ...
Figure 6-2.Order in which callback methods are called ■Tip Choose the best form submit callback to implement based on which obje ...
public String getFavoriteProgrammingLanguage() { return favoriteProgrammingLanguage; } public void setFavoriteProgrammingLanguag ...
return first + " " + last; } } Listing 6-41 contains the XHTML that matches the Personobject, while Figure 6-3 shows how the for ...
Figure 6-3.Initial form view The XHTML shown in Listing 6-41 has some interesting aspects. First, notice that we are using the P ...
protected void doSubmitAction(Object command) throws Exception { Person person = (Person) command; // persist the object, or som ...
The Controllerin this example is using logical Viewnames to identify which views should be rendered. This provides a nice decoup ...
Listing 6-45 contains the entire PersonFormControllercode, highlighting the referenceData()method. Listing 6-45.PersonFormContro ...
«
4
5
6
7
8
9
10
11
12
13
»
Free download pdf