narendraraghu / ppt

0 stars 1 forks source link

jh #1

Open narendraraghu opened 8 years ago

narendraraghu commented 8 years ago

20130418-thymeleaf-130418151812-phpapp02 (2) (1).pptx

narendraraghu commented 8 years ago
  1. http://www.thymeleaf.org/doc/articles/standarddialect5minutes.html 2. https://github.com/furkanzumrut/SpringThymeleafExample

  2. http://itutorial.thymeleaf.org/exercise/3

  3. http://spring.io/blog/2012/10/30/spring-mvc-from-jsp-and-tiles-to-thymeleaf/

  4. http://spring.io/blog/2012/10/30/spring-mvc-from-jsp-and-tiles-to-thymeleaf/

There are a few things that we can notice:

-This is an html file! You can actually preview it as a static file in your web browser. This feature is great for prototyping [1].

We are using a dedicated namespace in order to turn static html pages into dynamic views. All parts that require dynamic processing are prefixed with “th:”.

It’s simple to refer to the context path using ‘@{…}’. This is very easy to get wrong in plain JSPs [2].

${users} is resolved using Spring Expression Language. If I had a form, I would have used expressions such as *{user.name} to refer to form elements.

[1] We will not discuss prototyping any further in this article. However you can read this tutorial (http://www.thymeleaf.org/petclinic.html) if you would like to know more about it.

[2] In the first part of this article, when using , I had to use a relative path “../menu.jspx”. This will lead to a broken link on the day I’ll move my JSP file to a different folder.