security cleanup

This commit is contained in:
Eugen 2013-05-27 18:45:19 +03:00
parent 6ffd867e11
commit af424e266b
8 changed files with 59 additions and 59 deletions

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.web.config;
package org.baeldung.spring.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -13,27 +13,27 @@ import org.springframework.web.servlet.view.JstlView;
@Configuration
public class FrontendConfig extends WebMvcConfigurerAdapter {
public FrontendConfig() {
super();
}
public FrontendConfig() {
super();
}
// API
// API
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
super.addViewControllers(registry);
@Override
public void addViewControllers(final ViewControllerRegistry registry) {
super.addViewControllers(registry);
registry.addViewController("/homepage.html");
}
registry.addViewController("/homepage.html");
}
@Bean
public ViewResolver viewResolver() {
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
@Bean
public ViewResolver viewResolver() {
final InternalResourceViewResolver bean = new InternalResourceViewResolver();
bean.setViewClass(JstlView.class);
bean.setPrefix("/WEB-INF/view/");
bean.setSuffix(".jsp");
bean.setViewClass(JstlView.class);
bean.setPrefix("/WEB-INF/view/");
bean.setSuffix(".jsp");
return bean;
}
return bean;
}
}

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.web.config;
package org.baeldung.spring.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
@ -7,8 +7,8 @@ import org.springframework.context.annotation.ImportResource;
@ImportResource({ "classpath:webSecurityConfig.xml" })
public class SecSecurityConfig {
public SecSecurityConfig() {
super();
}
public SecSecurityConfig() {
super();
}
}

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.web.config;
package org.baeldung.spring.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@ -8,10 +8,10 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@ComponentScan("org.baeldung.spring.web.controller")
public class WebConfig extends WebMvcConfigurerAdapter {
public WebConfig() {
super();
}
public WebConfig() {
super();
}
// API
// API
}

View File

@ -1,28 +0,0 @@
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";
}
}

View File

@ -1,8 +1,8 @@
package org.baeldung.spring.web.controller;
package org.baeldung.web.controller;
import javax.servlet.http.HttpServletResponse;
import org.baeldung.spring.web.Foo;
import org.baeldung.web.dto.Foo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

View File

@ -0,0 +1,28 @@
package org.baeldung.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";
}
}

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.web;
package org.baeldung.web.dto;
import java.io.Serializable;

View File

@ -21,7 +21,7 @@
<authentication-provider>
<user-service>
<user name="temporary" password="temporary" authorities="ROLE_ADMIN" />
<user name="user" password="user" authorities="ROLE_USER" />
<user name="user" password="userPass" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</authentication-manager>