Expert Spring MVC and Web Flow
Service Interface As mentioned before, Spring MVC applications are typically layered with the service layer encapsulating the ac ...
■Tip For more notes on immutability for objects, consult Joshua Bloch’s excellent book Effective Java Programming Language Guide ...
For lack of a proper Moneytype, we use BigDecimalfor all monetary values. Why not simply use doubletype? The short answer is tha ...
Use Case #2 The second use case is more complicated because it returns a list of flights based on the user’s search conditions. ...
For this reason, we are flexible with the search criteria with the knowledge that the business logic of the system will do the r ...
this.legs = legs; this.totalCost = totalCost; } public BigDecimal getTotalCost() { return totalCost; } public boolean isNonStop( ...
Listing 4-5.FlightLeg Class public class FlightLeg { private Airport departFrom; private Date departOn; private Airport arriveAt ...
Listing 4-6.FlightService Interface public interface FlightService { List<SpecialDeal> getSpecialDeals(); List<Flight&g ...
Summary Before any work was done on the web layer, we first analyzed the use cases to develop both a domain object model and a s ...
Table 4-1 is represented graphically in Figure 4-1. Figure 4-1.Module-specific JAR dependencies for Spring 1.2.x and earlier ■Ti ...
Controllers Spring MVC delegates the responsibility for handling HTTP requests to Controllers. Controllers are much like servlet ...
Because the Controllers are totally unaware of the view technology, it is easy to mix and match the rendering toolkits and even ...
Listing 4-8.HomeController public class HomeController extends AbstractController { private static final int FIVE_MINUTES = 5*60 ...
■NoteBy default,AbstractControllerwill send the appropriate headers to disable caching. It is important to note that these types ...
■NoteThe URI-to-Controllermapping strategy is fully pluggable, making it easy to change if the default is not sufficient. Listin ...
${special.departFrom.name} - ${special.arriveAt.name} from $${special.cost} Search for a flight. ■CautionAlways place the ...
To turn on an InternalResourceViewResolver, simply define it as a bean in the spring- servlet.xmlfile, as we have done in Listin ...
ApplicationContextcontains the FlightServiceimplementation, and is named applicationContext.xml. This ApplicationContextmust be ...
With the root application configured, the last piece of this puzzle is now required. The main servlet for the application, which ...
URI Mapping to Controllers This is a good time to review how a full URI is mapped to a Controller. There are three compo- nents ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf