project cleanup

This commit is contained in:
eugenp 2013-07-14 14:45:56 +03:00
parent 47db09849e
commit c1d0444ec8
59 changed files with 81 additions and 64 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>spring-all</name> <name>spring-exceptions</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> <?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="spring-all"> <wb-module deploy-name="spring-exceptions">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="context-root" value="spring-all"/> <property name="context-root" value="spring-exceptions"/>
<property name="java-output-path" value="/spring-all/target/classes"/> <property name="java-output-path" value="/spring-exceptions/target/classes"/>
</wb-module> </wb-module>
</project-modules> </project-modules>

View File

@ -1,10 +1,10 @@
<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"> <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> <modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung</groupId> <groupId>org.baeldung</groupId>
<artifactId>spring-all</artifactId> <artifactId>spring-exceptions</artifactId>
<version>0.1-SNAPSHOT</version> <version>0.1-SNAPSHOT</version>
<name>spring-all</name> <name>spring-exceptions</name>
<packaging>war</packaging> <packaging>war</packaging>
<dependencies> <dependencies>
@ -122,7 +122,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>spring-all</finalName> <finalName>spring-exceptions</finalName>
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>

View File

@ -1,6 +1,7 @@
package org.baeldung.spring; package org.baeldung.spring;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
@ -8,7 +9,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
import org.springframework.web.servlet.view.InternalResourceViewResolver; import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView; import org.springframework.web.servlet.view.JstlView;
// @Configuration @Configuration
@EnableWebMvc @EnableWebMvc
public class MvcConfig extends WebMvcConfigurerAdapter { public class MvcConfig extends WebMvcConfigurerAdapter {

View File

@ -1,26 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security" <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" xsi:schemaLocation="
xsi:schemaLocation="
http://www.springframework.org/schema/security http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"> http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
<http use-expressions="true"> <http use-expressions="true">
<intercept-url pattern="/login*" access="permitAll" /> <intercept-url pattern="/login*" access="permitAll" />
<intercept-url pattern="/**" access="isAuthenticated()" /> <intercept-url pattern="/**" access="isAuthenticated()" />
<!-- <form-login login-page='/login.html' login-processing-url="/perform_login" <form-login
default-target-url="/homepage.html" authentication-failure-url="/login.html?error=true" --> login-page='/login.html'
<!-- always-use-default-target="true" /> --> login-processing-url="/perform_login"
default-target-url="/homepage.html"
authentication-failure-url="/login.html?error=true"
always-use-default-target="true"/>
<http-basic /> <http-basic />
</http> </http>
<authentication-manager> <authentication-manager>
<authentication-provider ref="customAuthenticationProvider" /> <authentication-provider ref="customAuthenticationProvider" />
</authentication-manager> </authentication-manager>
</beans:beans> </beans:beans>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd" >
</beans>

View File

@ -1,52 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" xsi:schemaLocation="
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
id="WebApp_ID" version="3.0">
<display-name>Spring Security Custom Application</display-name> <display-name>Spring Security Custom Application</display-name>
<!-- Spring root --> <!-- Spring root -->
<context-param> <context-param>
<param-name>contextClass</param-name> <param-name>contextClass</param-name>
<param-value> <param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value> </param-value>
</context-param> </context-param>
<context-param> <context-param>
<param-name>contextConfigLocation</param-name> <param-name>contextConfigLocation</param-name>
<param-value>org.baeldung.spring</param-value> <param-value>org.baeldung.spring</param-value>
</context-param> </context-param>
<listener> <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> </listener>
<!-- Spring child --> <!-- Spring child -->
<servlet> <servlet>
<servlet-name>api</servlet-name> <servlet-name>api</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup> <load-on-startup>1</load-on-startup>
</servlet> </servlet>
<servlet-mapping> <servlet-mapping>
<servlet-name>api</servlet-name> <servlet-name>api</servlet-name>
<url-pattern>/api/*</url-pattern> <url-pattern>/api/*</url-pattern>
</servlet-mapping> </servlet-mapping>
<!-- Spring Security --> <servlet>
<filter> <servlet-name>mvc</servlet-name>
<filter-name>springSecurityFilterChain</filter-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> <load-on-startup>1</load-on-startup>
</filter> </servlet>
<filter-mapping> <servlet-mapping>
<filter-name>springSecurityFilterChain</filter-name> <servlet-name>mvc</servlet-name>
<url-pattern>/*</url-pattern> <url-pattern>/*</url-pattern>
</filter-mapping> </servlet-mapping>
<welcome-file-list> <!-- Spring Security -->
<welcome-file>index.html</welcome-file> <filter>
</welcome-file-list> <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>
<!-- <welcome-file-list> -->
<!-- <welcome-file>index.html</welcome-file> -->
<!-- </welcome-file-list> -->
</web-app> </web-app>