File tree Expand file tree Collapse file tree
spring-security-basic-auth/src/main/java/org/baeldung
spring-security-rest/src/main/resources Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- package org .baeldung .spring .web . config ;
1+ package org .baeldung .spring .config ;
22
33import org .springframework .context .annotation .Bean ;
44import org .springframework .context .annotation .Configuration ;
1313@ Configuration
1414public class FrontendConfig extends WebMvcConfigurerAdapter {
1515
16- public FrontendConfig () {
17- super ();
18- }
16+ public FrontendConfig () {
17+ super ();
18+ }
1919
20- // API
20+ // API
2121
22- @ Override
23- public void addViewControllers (final ViewControllerRegistry registry ) {
24- super .addViewControllers (registry );
22+ @ Override
23+ public void addViewControllers (final ViewControllerRegistry registry ) {
24+ super .addViewControllers (registry );
2525
26- registry .addViewController ("/homepage.html" );
27- }
26+ registry .addViewController ("/homepage.html" );
27+ }
2828
29- @ Bean
30- public ViewResolver viewResolver () {
31- final InternalResourceViewResolver bean = new InternalResourceViewResolver ();
29+ @ Bean
30+ public ViewResolver viewResolver () {
31+ final InternalResourceViewResolver bean = new InternalResourceViewResolver ();
3232
33- bean .setViewClass (JstlView .class );
34- bean .setPrefix ("/WEB-INF/view/" );
35- bean .setSuffix (".jsp" );
33+ bean .setViewClass (JstlView .class );
34+ bean .setPrefix ("/WEB-INF/view/" );
35+ bean .setSuffix (".jsp" );
3636
37- return bean ;
38- }
37+ return bean ;
38+ }
3939}
Original file line number Diff line number Diff line change 1- package org .baeldung .spring .web . config ;
1+ package org .baeldung .spring .config ;
22
33import org .springframework .context .annotation .Configuration ;
44import org .springframework .context .annotation .ImportResource ;
77@ ImportResource ({ "classpath:webSecurityConfig.xml" })
88public class SecSecurityConfig {
99
10- public SecSecurityConfig () {
11- super ();
12- }
10+ public SecSecurityConfig () {
11+ super ();
12+ }
1313
1414}
Original file line number Diff line number Diff line change 1- package org .baeldung .spring .web . config ;
1+ package org .baeldung .spring .config ;
22
33import org .springframework .context .annotation .ComponentScan ;
44import org .springframework .context .annotation .Configuration ;
88@ ComponentScan ("org.baeldung.spring.web.controller" )
99public class WebConfig extends WebMvcConfigurerAdapter {
1010
11- public WebConfig () {
12- super ();
13- }
11+ public WebConfig () {
12+ super ();
13+ }
1414
15- // API
15+ // API
1616
1717}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- package org .baeldung .spring . web .controller ;
1+ package org .baeldung .web .controller ;
22
33import javax .servlet .http .HttpServletResponse ;
44
5- import org .baeldung .spring . web .Foo ;
5+ import org .baeldung .web . dto .Foo ;
66import org .springframework .stereotype .Controller ;
77import org .springframework .web .bind .annotation .PathVariable ;
88import org .springframework .web .bind .annotation .RequestMapping ;
Original file line number Diff line number Diff line change 1+ package org .baeldung .web .controller ;
2+
3+ import org .springframework .stereotype .Controller ;
4+ import org .springframework .web .bind .annotation .RequestMapping ;
5+ import org .springframework .web .bind .annotation .ResponseBody ;
6+
7+ @ Controller
8+ public class TestController {
9+
10+ public TestController () {
11+ super ();
12+ }
13+
14+ // API
15+
16+ @ RequestMapping ("/permitAll" )
17+ @ ResponseBody
18+ public String permitAll () {
19+ return "Permit All" ;
20+ }
21+
22+ @ RequestMapping ("/securityNone" )
23+ @ ResponseBody
24+ public String securityNone () {
25+ return "Security None" ;
26+ }
27+
28+ }
Original file line number Diff line number Diff line change 1- package org .baeldung .spring . web ;
1+ package org .baeldung .web . dto ;
22
33import java .io .Serializable ;
44
Original file line number Diff line number Diff line change 2121 <authentication-provider >
2222 <user-service >
2323 <user name =" temporary" password =" temporary" authorities =" ROLE_ADMIN" />
24- <user name =" user" password =" user " authorities =" ROLE_USER" />
24+ <user name =" user" password =" userPass " authorities =" ROLE_USER" />
2525 </user-service >
2626 </authentication-provider >
2727 </authentication-manager >
You can’t perform that action at this time.
0 commit comments