Browse Source

Implement & enable UrlTemplateResolver for HTML fragment URLs

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.3-alpha
Pekka Helenius 4 years ago
parent
commit
45ed308851
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java

+ 9
- 0
bookstore/src/main/java/com/fjordtek/bookstore/BookstoreApplication.java View File

@ -13,6 +13,7 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.factory.PasswordEncoderFactories; import org.springframework.security.crypto.factory.PasswordEncoderFactories;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import org.thymeleaf.templateresolver.UrlTemplateResolver;
import com.fjordtek.bookstore.model.auth.Role; import com.fjordtek.bookstore.model.auth.Role;
import com.fjordtek.bookstore.model.auth.RoleRepository; import com.fjordtek.bookstore.model.auth.RoleRepository;
@ -49,6 +50,14 @@ public class BookstoreApplication extends SpringBootServletInitializer {
SpringApplication.run(BookstoreApplication.class, args); SpringApplication.run(BookstoreApplication.class, args);
} }
@Bean
public UrlTemplateResolver urlTemplateResolver() {
UrlTemplateResolver urlTemplateResolver = new UrlTemplateResolver();
urlTemplateResolver.setCacheable(true);
urlTemplateResolver.getCharacterEncoding();
return urlTemplateResolver;
}
@Bean @Bean
public CommandLineRunner userDatabaseRunner( public CommandLineRunner userDatabaseRunner(
UserRepository userRepository, UserRepository userRepository,


Loading…
Cancel
Save