This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.kata.spring.boot_security.demo.controllers; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.http.HttpHeaders; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.ResponseEntity; | |
import org.springframework.web.bind.annotation.*; | |
import ru.kata.spring.boot_security.demo.entity.User; | |
import ru.kata.spring.boot_security.demo.service.RoleService; | |
import ru.kata.spring.boot_security.demo.service.UserService; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package web.config; | |
import org.springframework.web.filter.HiddenHttpMethodFilter; | |
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; | |
import javax.servlet.ServletContext; | |
import javax.servlet.ServletException; | |
public class AppInit extends AbstractAnnotationConfigDispatcherServletInitializer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package web.config; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.ComponentScan; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.web.servlet.config.annotation.EnableWebMvc; | |
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; | |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | |
import org.thymeleaf.spring5.SpringTemplateEngine; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package web.config; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.ComponentScan; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.PropertySource; | |
import org.springframework.core.env.Environment; | |
import org.springframework.jdbc.datasource.DriverManagerDataSource; | |
import org.springframework.orm.jpa.JpaTransactionManager; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Scope; | |
@Configuration | |
public class AppConfig { | |
@Bean(name = "helloworld") | |
public HelloWorld getHelloWorld() { | |
HelloWorld helloWorld = new HelloWorld(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jm.task.core.jdbc.util; | |
import jm.task.core.jdbc.model.User; | |
import org.hibernate.HibernateException; | |
import org.hibernate.SessionFactory; | |
import org.hibernate.boot.registry.StandardServiceRegistry; | |
import org.hibernate.boot.registry.StandardServiceRegistryBuilder; | |
import org.hibernate.cfg.Configuration; | |
import org.hibernate.cfg.Environment; |