security work
This commit is contained in:
@@ -11,9 +11,9 @@ import org.springframework.web.servlet.view.JstlView;
|
||||
|
||||
@EnableWebMvc
|
||||
@Configuration
|
||||
public class ClientWebConfig extends WebMvcConfigurerAdapter {
|
||||
public class FrontendConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
public ClientWebConfig() {
|
||||
public FrontendConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ public class ClientWebConfig extends WebMvcConfigurerAdapter {
|
||||
public void addViewControllers(final ViewControllerRegistry registry) {
|
||||
super.addViewControllers(registry);
|
||||
|
||||
registry.addViewController("/login.html");
|
||||
registry.addViewController("/homepage.html");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.baeldung.spring.web.config;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("org.baeldung.spring.web.controller")
|
||||
public class WebConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
public WebConfig() {
|
||||
super();
|
||||
}
|
||||
|
||||
// API
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.baeldung.spring.web.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
public class TestController {
|
||||
|
||||
public TestController() {
|
||||
super();
|
||||
}
|
||||
|
||||
// API
|
||||
|
||||
@RequestMapping("/permitAll")
|
||||
@ResponseBody
|
||||
public String permitAll() {
|
||||
return "Permit All";
|
||||
}
|
||||
|
||||
@RequestMapping("/securityNone")
|
||||
@ResponseBody
|
||||
public String securityNone() {
|
||||
return "Security None";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user