Posts

hide and show div tag in JS

**  Setting the display property of an element only changes  how the element is displayed , NOT what kind of element it is. So, an inline element with  display: block;  is not allowed to have other block elements inside it. The  display  property is used to specify how an element is shown on a web page. Every HTML element has a default display value, depending on what type of element it is. The default display value for most elements is  block  or  inline . The   display   property is used to change the default display behavior of HTML elements. display: none;  is commonly used with JavaScript to hide and show elements without deleting and recreating them. visibility:hidden;  also hides an element. However, the element will still take up the same space as before. The element will be hidden, but still affect the layout: Example h1.hidden  {   visibility :  hidden ; }       <!DOCTYPE htm...

Standard URL Syntax

  Standard URL Syntax The Thymeleaf standard dialects –called  Standard  and  SpringStandard – offer a way to easily create URLs in your web applications so that they include any required  URL preparation  artifacts. This is done by means of the so-called  link expressions , a type of  Thymeleaf Standard Expression :  @{...} Absolute URLs Absolute URLs allow you to create links to other servers. They start by specifying a protocol name ( http://  or  https:// ) < a th: href = " @{http://www.thymeleaf/documentation.html} " > They are not modified at all (unless you have an  URL Rewriting  filter configured at your server and performing modifications at the  HttpServletResponse.encodeUrl(...)  method): < a href = " http://www.thymeleaf/documentation.html " > Context-relative URLs The most used type of URLs are  context-relative  ones. These are URLs which are supposed to be relative to the w...

Thymeleaf + Spring Security integration basics

  Thymeleaf + Spring Security integration basics Written by José Miguel Samper <jmiguelsamper AT users.sourceforge.net> Have you switched to Thymeleaf but your login and error pages are still using JSP? In this article we will see how to configure your Spring application to use Thymeleaf for login and error pages. All the code seen here comes from a working application. You can view or download the source code from  its GitHub repo . Note  that the Thymeleaf integration packages for Spring Security support both Spring MVC and Spring WebFlux applications since Spring Security 5, but this article will focus on a Spring MVC configuration. Prerequisites We assume you are familiar with Thymeleaf and Spring Security, and you have a working application using these technologies. If you don’t know Spring Security, you could be interested on reading the  Spring Security Documentation . Login pages With Spring Security you could specify any URL to act as a login page, jus...