Skip to content

Dimanaux/java-spring-boot-neo4j-emailer

Repository files navigation

java-spring-boot-neo4j-emailer

How to set up Spring Security tags for Freemarker?

  1. Add maven dependencies
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-taglibs</artifactId>
    <version>5.1.5.RELEASE</version>
    <scope>${defaultScope}</scope>
</dependency>
  1. Create these 2 classes somewhere in your project.

  2. Insert <#assign security=JspTaglibs["http://www.springframework.org/security/tags"]/> into the top of your Freemarker template.

  3. Use as

<@security.authorize access="isAuthenticated()">
    logged in as <@security.authentication property="principal.username" />
    <li class="nav-item">
        <a class="nav-link" href="/sign_out">Sign out</a>
    </li>
</@security.authorize>

Jump to:

  1. Aspects
  2. validation TODO
  3. ajax + controller, 2
  4. TODO chat plugin
  5. spring data jpa NEO4J!
  6. Docker TODO
  7. Vue.js JS, Vue.js FTL
  8. FreeMarker + spring security tags
  9. postgresql + neo4j
  10. spring security config
  11. oauth