Posts

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...

inside login page : how to redirect another page & allow to authentication ??

   <a sec:authorize="hasAnyAuthority('ROLE_USER')" th:href="@{/index}"> <p class="viewAccount" >  View Account   </p></a> ---------------------------------------------------------------------------------------------------------------------- <div sec:authorize="isAuthenticated()" id="id02" class="modal">  ....................................... </div>

SQL - where and order clause together

  When you run a SELECT query without any sorting options, the SQL server returns the records in an indiscriminate order. In most cases, the SQL server returns records in the same order they are added to the database. There is no guarantee that records are returned in a specific order when you don't use sorting options in SQL. In addition to sorting, you also use filtering options to return only specific records that match your requirements.  Sorting Your Records SQL uses the ORDER BY statement to sort records. You can sort records in ascending or descending order, and you can sort records based on multiple columns. SQL lets you sort alphabetically, numerically or chronologically.  For instance, suppose you want to get a list of your customers, and you need the list in alphabetical order by state. The following is your current list of customers.  CustomerId First_name Last_name City State 321 Frank Loe Dallas TX 455 Ed Thompson Atlanta GA 456 Ed Thompson Atlanta GA 4...

Text inlining in HTML, CSS, JAVASCRIPT

  12.2 Text inlining Text inlining  is very similar to the  expression inlining  capability we have just seen, but it actually adds more power. It has to be enabled explicitly with  th:inline="text" . Text inlining not only allows us to use the same  inlined expressions  we just saw, but in fact processes  tag bodies  as if they were templates processed in the  TEXT  template mode, which allows us to perform text-based template logic (not only output expressions). We will see more about this in the next chapter about the  textual template modes . 12.3 JavaScript inlining JavaScript inlining allows for a better integration of JavaScript  <script>  blocks in templates being processed in the  HTML  template mode. As with  text inlining , this is actually equivalent to processing the scripts contents as if they were templates in the  JAVASCRIPT  template mode, and therefore all the power of ...