tailieunhanh - Expert Spring MVC and Web Flow phần 7

chứng thực có hiệu quả đậu lệnh hoàn thành. Bộ điều khiển này không nên được sử dụng cho dòng chảy công việc tùy ý. Thay vào đó, bạn nên sử dụng lưu lượng Web Spring, có khả năng xử lý các thay đổi trạng thái phức tạp và dòng chảy trang. | CHAPTER 8 SUPPORTED VIEW TYPES 235 Summary- Tiles is a rich technology for creating components in your web pages and our overview of Spring s Tiles support doesn t scratch the surface of what can be achieved with this view type. If you re new to Tiles or if you d like further information on Spring s Tiles support see Pro Spring Apress 2004 which has a much more in-depth examination. Velocity and FreeMarker Velocity http velocity and FreeMarker http are both templating technologies. They are purely text-based engines and both are in widespread use in applications of all kinds that produce text output. Obviously web applications are one such subset. As our topic is Web MVC applications though we re going to consider just that aspect of them both. CHOOSING A TEMPLATING LANGUAGE Choosing between Velocity and FreeMarker is a discussion beyond the scope of this book. The only real differences from a technical point of view in applying these engines in a Spring application is in their respective templating languages. If you have no experience of either but would like to try them we suggest perusing the documentation for both at their respective websites and deciding which suits you and your team best. Templating Pros and Cons Unlike JSP Velocity and FreeMarker templates are not compiled into Java classes rather they are interpreted by their respective template engines. This makes them more akin to XSLT than JSR Despite this there seems to be no performance penalty in applying either of them in place of JSR In fact in many benchmarks Velocity outperforms JSP as the view layer. This is because although not compiled to byte code the templates are cached in an efficient binary format by the template engines when they are first read. An advantage of both over JSP is that you can t easily break out of the templating language and start coding Java so there s less danger that domain logic will leak into the view layer with either of these .

TỪ KHÓA LIÊN QUAN