尝试使用Spring Boot显示JSP时出错.这是我的配置:
我的JSP文件是准系统:
TEST
Run Code Online (Sandbox Code Playgroud)
这是我的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.edhec</groupId>
<artifactId>stdapps</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>stdapps</name>
<description>Project stdapps</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.3.6.Final</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId> …Run Code Online (Sandbox Code Playgroud) 我正在制作一个测试项目,为我们未来的项目尝试弹簧启动.
我们正在使用jasig CAS,我正在尝试使用spring boot和嵌入式tomcat服务器进行配置.
所以我添加了pom.xml spring-boot-starter-security
之后我尝试配置WebSecurityConfig - > spring提供了用cas配置的类,例如我需要配置一个入口点:
@Bean
public CasAuthenticationEntryPoint casAuthenticationEntryPoint() {
CasAuthenticationEntryPoint casAuthenticationEntryPoint = new CasAuthenticationEntryPoint();
casAuthenticationEntryPoint.setLoginUrl("https://localhost:9443/cas/login");
casAuthenticationEntryPoint.setServiceProperties(serviceProperties());
return casAuthenticationEntryPoint;
}
Run Code Online (Sandbox Code Playgroud)
这是第一个问题:应用程序未重新配置org.springframework.security.cas.web.CasAuthenticationEntryPoint类.
该类似乎没有使用spring-boot-starter-security导入.
什么是最佳做法?我是否必须像以前那样在我的pom中手动添加依赖项?
例如:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-cas</artifactId>
<version>${spring-security.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)
如果是这样,我需要使用哪个版本来配合启动版本包并避免冲突?
第二点是如何配置嵌入式tomcat以启用带证书的ssl?
这是我对CAS的经典server.xml配置:
Connector emptySessionPath="true" port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="true" URIEncoding="UTF-8"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="C:\***\***\***\.keystore" keystorePass="***"
truststoreFile="C:\Program Files\Java\jdk1.7.0_67\jre\lib\security\cacerts"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript"/>
Run Code Online (Sandbox Code Playgroud)
是否可以使用嵌入式tomcat配置keystorefile/truststorefile?
谢谢