This repository was archived by the owner on Dec 15, 2021. It is now read-only.
File tree 4 files changed +51
-12
lines changed
java/org/springframework/issues 4 files changed +51
-12
lines changed Original file line number Diff line number Diff line change 12
12
13
13
<java .version>1.6</java .version>
14
14
<spring .version>4.2.1.BUILD-SNAPSHOT</spring .version>
15
+ <spring-security .version>4.0.2.RELEASE</spring-security .version>
15
16
<slf4j .version>1.7.5</slf4j .version>
16
17
17
18
<jetty .version>9.1.2.v20140210</jetty .version>
42
43
<artifactId >spring-webmvc</artifactId >
43
44
<version >${spring.version} </version >
44
45
</dependency >
46
+ <dependency >
47
+ <groupId >org.springframework.security</groupId >
48
+ <artifactId >spring-security-config</artifactId >
49
+ <version >${spring-security.version} </version >
50
+ </dependency >
51
+ <dependency >
52
+ <groupId >org.springframework.security</groupId >
53
+ <artifactId >spring-security-web</artifactId >
54
+ <version >${spring-security.version} </version >
55
+ </dependency >
45
56
46
57
<!-- Logging -->
47
58
<dependency >
Original file line number Diff line number Diff line change 16
16
17
17
package org .springframework .issues ;
18
18
19
- import java .text .DateFormat ;
20
- import java .util .Date ;
21
- import java .util .Locale ;
22
- import javax .servlet .http .HttpServletResponse ;
23
-
24
19
import org .slf4j .Logger ;
25
20
import org .slf4j .LoggerFactory ;
26
-
27
21
import org .springframework .stereotype .Controller ;
28
22
import org .springframework .ui .Model ;
29
23
import org .springframework .web .bind .annotation .RequestMapping ;
30
24
import org .springframework .web .bind .annotation .RequestMethod ;
31
25
26
+ import java .text .DateFormat ;
27
+ import java .util .Date ;
28
+ import java .util .Locale ;
29
+
32
30
@ Controller
33
31
public class ScriptTemplateController {
34
32
35
33
private static final Logger logger = LoggerFactory
36
34
.getLogger (ScriptTemplateController .class );
37
35
38
- @ RequestMapping (method = RequestMethod .GET )
39
- public String home (Locale locale , Model model , HttpServletResponse response ) {
36
+ @ RequestMapping (path = { "" , "security-with*" }, method = RequestMethod .GET )
37
+ public String home (Locale locale , Model model ) {
40
38
logger .info ("Welcome home! The client locale is {}." , locale );
41
39
42
40
DateFormat dateFormat = DateFormat .getDateTimeInstance (DateFormat .LONG ,
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<beans xmlns =" http://www.springframework.org/schema/beans"
3
- xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
4
- xsi:schemaLocation="
5
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd" >
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xmlns : sec =" http://www.springframework.org/schema/security"
5
+ xsi : schemaLocation ="
6
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
7
+ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd" >
6
8
7
9
<!-- Root Context: defines shared resources visible to all other web components -->
8
-
10
+ <sec : http auto-config =" true" pattern =" /security-with-cto/**" >
11
+ <sec : headers >
12
+ <sec : content-type-options />
13
+ </sec : headers >
14
+ </sec : http >
15
+
16
+ <sec : http auto-config =" true" pattern =" /security-without-cto/**" >
17
+ <sec : headers >
18
+ <sec : content-type-options disabled =" true" />
19
+ </sec : headers >
20
+ </sec : http >
21
+
22
+ <sec : authentication-manager >
23
+ <sec : authentication-provider >
24
+ <sec : user-service >
25
+ <sec : user name =" demo" authorities =" ROLE_USER" />
26
+ </sec : user-service >
27
+ </sec : authentication-provider >
28
+ </sec : authentication-manager >
29
+
9
30
</beans >
Original file line number Diff line number Diff line change 12
12
<listener-class >org.springframework.web.context.ContextLoaderListener</listener-class >
13
13
</listener >
14
14
15
+ <filter >
16
+ <filter-name >springSecurityFilterChain</filter-name >
17
+ <filter-class >org.springframework.web.filter.DelegatingFilterProxy</filter-class >
18
+ </filter >
19
+ <filter-mapping >
20
+ <filter-name >springSecurityFilterChain</filter-name >
21
+ <url-pattern >/*</url-pattern >
22
+ </filter-mapping >
23
+
15
24
<servlet >
16
25
<servlet-name >appServlet</servlet-name >
17
26
<servlet-class >org.springframework.web.servlet.DispatcherServlet</servlet-class >
You can’t perform that action at this time.
0 commit comments