security work

This commit is contained in:
eparaschiv
2013-05-22 20:52:33 +03:00
parent 47bfc87401
commit dd8debd720
4 changed files with 69 additions and 18 deletions

View File

@@ -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");
}

View File

@@ -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
}

View File

@@ -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";
}
}