Expert Spring MVC and Web Flow
Listing 8-44.Using a URI Extension As a Mapping Key public ModelAndView handleMultiReport( HttpServletRequest request, HttpServl ...
Listing 8-45.Specifying a Report Data Key for the Jasper Report home.class=org.springframework.web.servlet.view.jasperreports.Ja ...
Summary In this chapter we’ve looked at the various technologies that can be used within your Spring Web MVC application, includ ...
Validation Command objects that have been populated by DataBindercan be validated and report back errors when validation fails. ...
Listing 9-2.Validator Implementation for Address Objects package com.apress.expertspringmvc.validation; import org.springframewo ...
As you can see, this Validatorsimply checks whether the required fields have been set. More complex constraints can be added as ...
Listing 9-5.Valang Validator and Configuration for Address Objects <bean id="easyAddressValidator" ➥ class="org.springmodules ...
Listing 9-8.Example of Complex Boolean Logic in Valang { postalCode : (? is blank or country is blank) or ((country in 'United S ...
Table 9-1.Continued Operator Types Null Safe Description IS NULL, NULL Any Yes (true)Tests value to the left is null. IS NOT NUL ...
Internally Valang converts property number values to java.math.BigDecimal, while BigDecimalalso parses number literals. Valang’s ...
To make sure Trepresents the time of validation and not the time of parsing the syntax, Valang parses date literals every time t ...
Shift operators and incremental operators can be combined to create new timestamps. If we want to test whether the order timesta ...
Valang allows you to specify other date formats. For each custom date format you add to the date parser you need to provide a re ...
Custom functions can be registered with Valang to include in your constraints. To imple- ment a custom function you need to exte ...
Custom Valang function classes often need collaborating objects to do their work. These objects can be autowired by name or by t ...
has to be injected. The isAutowireByName()method returns true, so a bean definition named jdbcTemplateneeds to be configured in ...
Message Sources The Spring ApplicationContextimplements the org.springframework.context.MessageSource interface used to resolve ...
Validators and Business Logic Validators are related to the presentation layer. However, if objects that are validated by a Vali ...
Listing 9-22.rejectValue() Methods in the org.springframework.validation.Errors Interface public void rejectValue(String propert ...
} return this.addressValidator; } } pushNestedPathadds the path to the existing nested path if one is set; otherwise, the nested ...
«
10
11
12
13
14
15
16
17
18
19
»
Free download pdf