Caution
This version is already obsolete. Please check the latest guideline.
Table of contents
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-security-core</artifactId> <!-- (1) -->
</dependency>
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-security-web</artifactId> <!-- (2) -->
</dependency>
Sr. No. | Description |
---|---|
(1)
|
terasoluna-gfw-security-core is not web dependent. As a result, when using from a domain layer project,
only terasoluna-gfw-security-core should be added to dependency.
|
(2)
|
terasoluna-gfw-web provides web related functionalities. It is dependent on terasoluna-gfw-security-core as well. Hence,
for Web projects, only terasoluna-gfw-security-web should be added to dependency.
|
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value> <!-- (1) -->
classpath*:META-INF/spring/applicationContext.xml
classpath*:META-INF/spring/spring-security.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<filter>
<filter-name>springSecurityFilterChain</filter-name> <!-- (2) -->
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> <!-- (3) -->
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern> <!-- (4) -->
</filter-mapping>
Sr. No. | Description |
---|---|
(1)
|
In addition to applicationContext.xml, add the Spring Security configuration file to
the class path in contextConfigLocation. In this guideline, it is “spring-security.xml” file.
|
(2)
|
filter-name should be defined as the Bean name to be used internally in Spring Security, namely, “springSecurityFilterChain”.
|
(3)
|
Spring Security filter settings to enable various functionalities. |
(4)
|
Enable the settings for all requests. |
spring-mvc.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sec="http://www.springframework.org/schema/security"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<sec:http use-expressions="true"> <!-- (1) -->
<!-- omitted -->
</sec:http>
</beans>
Sr. No. |
Description |
---|---|
(1)
|
Spring EL expressions of access attribute can be enabled by setting use-expressions=”true”.
|
Note
For the Spring EL expressions enabled by use-expressions=”true”, please refer the following.