Содержание
- 2. History
- 3. Servlets Hello! public class HelloWorldServlet extends HttpServlet { protected void doGet(request, response) { response.setContentType("text/html"); PrintWriter out
- 4. Servlets Hello! public class HelloWorldServlet extends HttpServlet { protected void doGet(request, response) { request.getRequestDispatcher("/login.jsp"). forward(request, response);
- 5. Java Servlet-JSP Architecture Server Hello World! Java Jasper JSPs Servlet container
- 6. Templates
- 7. Template – document or parts of document with basic configuration. Table with dynamic content Left menu
- 8. Spring templates. Apache Velocity FreeMarker Rythm Thymeleaf 3.8 seconds 4.8 seconds 3 seconds 43.2 seconds Results
- 9. Thymeleaf. Thymeleaf integration with Spring framework.
- 10. Custom properties Core is a DOM processing engine. It is based on XML tags and attributes.
- 11. Syntax compare FreeMarker syntax: ${animal.name} ${animal.price} ApacheVelocity syntax: #foreach($mud in $mudsOnSpecial) #if($customer.hasPurchased($mud)) $flogger.getPromo($mud) #end #end
- 12. Syntax compare Thymeleaf syntax: NAME PRICE IN STOCK Onions 2.41 yes
- 13. Integration with Spring framework Spring application context: Html file template:
- 14. Standard dialect Expressions: Variable Expressions: ${...} Selection Variable Expressions: *{...} Message Expressions: #{...} Link URL Expressions:
- 15. Expression Utility Objects: #dates : utility methods for java.util.Date objects: formatting, component extraction, etc. #calendars :
- 16. Dialect extension: xmlns:th="http://www.thymeleaf.org">
- 17. Messages internationalization Application context: Class path:
- 18. Fragmentation footer.html ... Footer copyrights ... Index.html ... ...
- 19. Usage Examples Object expression: Today is: 11 March 2016 Links usage: view view Conditions usage: ...-
- 20. Default expression: Some value Setting attribute: Forms: Iteration: Onions 2.41
- 21. Local variable: Some Name . Set values to JavaScript: /* */ Switch: User is an administrator
- 22. Summary Advatages: Java template engine for XML, XHTML and HTML5. Works both in web and non-web
- 24. Скачать презентацию