Add Hello Spring Security Xml Config project
Closes gh-25
This commit is contained in:
12
servlet/xml/java/helloworld/src/main/resources/logback.xml
Normal file
12
servlet/xml/java/helloworld/src/main/resources/logback.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="WARN">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<b:beans xmlns="http://www.springframework.org/schema/security"
|
||||
xmlns:b="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/security https://www.springframework.org/schema/security/spring-security.xsd">
|
||||
<http />
|
||||
|
||||
<user-service>
|
||||
<user name="user" password="{noop}password" authorities="ROLE_USER" />
|
||||
</user-service>
|
||||
</b:beans>
|
||||
36
servlet/xml/java/helloworld/src/main/webapp/WEB-INF/web.xml
Normal file
36
servlet/xml/java/helloworld/src/main/webapp/WEB-INF/web.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
|
||||
https://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
|
||||
|
||||
<!--
|
||||
- Location of the XML file that defines the root application context
|
||||
- Applied by ContextLoaderListener.
|
||||
-->
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/spring/*.xml
|
||||
</param-value>
|
||||
</context-param>
|
||||
|
||||
|
||||
<filter>
|
||||
<filter-name>springSecurityFilterChain</filter-name>
|
||||
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>springSecurityFilterChain</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<!--
|
||||
- Loads the root application context of this web app at startup.
|
||||
- The application context is then available via
|
||||
- WebApplicationContextUtils.getWebApplicationContext(servletContext).
|
||||
-->
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener>
|
||||
</web-app>
|
||||
38
servlet/xml/java/helloworld/src/main/webapp/index.jsp
Normal file
38
servlet/xml/java/helloworld/src/main/webapp/index.jsp
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
|
||||
xmlns:c="http://java.sun.com/jsp/jstl/core" version="2.0">
|
||||
|
||||
<jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
|
||||
<jsp:output omit-xml-declaration="true" />
|
||||
<jsp:output doctype-root-element="HTML"
|
||||
doctype-system="about:legacy-compat" />
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Hello Security</title>
|
||||
<c:url var="faviconUrl" value="/resources/img/favicon.ico"/>
|
||||
<link rel="icon" type="image/x-icon" href="${faviconUrl}"/>
|
||||
<c:url var="bootstrapUrl" value="/resources/css/bootstrap.css"/>
|
||||
<link href="${bootstrapUrl}" rel="stylesheet"></link>
|
||||
<c:url var="bootstrapResponsiveUrl" value="/resources/css/bootstrap-responsive.css"/>
|
||||
<link href="${bootstrapResponsiveUrl}" rel="stylesheet"></link>
|
||||
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>This is secured!</h1>
|
||||
<p>
|
||||
Hello <b>${pageContext.request.remoteUser}</b>
|
||||
</p>
|
||||
<c:url var="logoutUrl" value="/logout"/>
|
||||
<form class="form-inline" action="${logoutUrl}" method="post">
|
||||
<input type="submit" value="Log out" />
|
||||
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</jsp:root>
|
||||
1092
servlet/xml/java/helloworld/src/main/webapp/resources/css/bootstrap-responsive.css
vendored
Normal file
1092
servlet/xml/java/helloworld/src/main/webapp/resources/css/bootstrap-responsive.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6039
servlet/xml/java/helloworld/src/main/webapp/resources/css/bootstrap.css
vendored
Normal file
6039
servlet/xml/java/helloworld/src/main/webapp/resources/css/bootstrap.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user