Expert Spring MVC and Web Flow
And finally, if there are no errors with page 2, the success screen is displayed (Figure 6-8). Figure 6-8.Wizard success page Pu ...
JSP Files We are taking advantage of many different Spring JSP tags when building these pages. Along with the usual tag, we are ...
<tr> <td><label for="${status.expression}" <c:if test="${status.error}">class="error"</c:if>>Usern ...
The first thing to point out is the two hidden input fields that control the page flow of the wizard. We are specifyi ...
The first element we want to pull out of the file is the printing of all the error messages above the form. This code won’t chan ...
${name}: This tag file encapsulates the printing of the table row, checking whether the field has an error, and filling o ...
<table> <spring:nestedPath path="account"> <tag:formField name="Username" path="username" /> <tag:formField ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Create an ...
Due to our tag files, this page is fairly succinct and easy to read. Another reason for this is our use of the <spring:nested ...
Listing 6-72.Wizard Command Class public class CreateAccount { private Account account = new Account(); private String confirmPa ...
setCommandClass(CreateAccount.class); setValidator(new CreateAccountValidator()); setPages(new String[]{"usernameAndEmail", "bil ...
Validation is done in piecemeal style as the user moves through the wizard, validating only parts of the command bean on each st ...
The lack of the presence of the Servlet API can be considered a benefit, as it makes it easier to test this class. There is no n ...
public ModelAndView execute() throws Exception { if (!StringUtils.hasText(username)) { return new ModelAndView("cancelAccount", ...
Summary The ThrowawayControlleris an alternate request handling method compared to the Controllers we’ve seen so far. It is inte ...
Listing 6-78.HandlerInterceptor Interface public interface HandlerInterceptor { boolean preHandle(HttpServletRequest request, Ht ...
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Excep ...
Controllers Summary One of Spring MVC’s major strengths is its rich collection of Controlleroptions. From the very simple (Contr ...
This chapter has briefly mentioned validation, which controllers like SimpleFormController and AbstractWizardFormControllerhave ...
The View Layer This chapter discusses the user interface layer, or view layer, of your Web MVC application. We investigate what ...
«
6
7
8
9
10
11
12
13
14
15
»
Free download pdf