From 105ccb067acd3090b45e486dd256eef513f2fe62 Mon Sep 17 00:00:00 2001 From: eugenp Date: Sun, 14 Jul 2013 15:01:13 +0300 Subject: [PATCH] clarification on the mvc vs rest projects --- spring-security-basic-auth/README.md | 4 ++ spring-security-custom/.project | 2 +- .../org.eclipse.wst.common.component | 6 +-- spring-security-custom/.springBeans | 2 +- spring-security-custom/pom.xml | 6 +-- .../java/org/baeldung/spring/MvcConfig.java | 40 ------------------- .../src/main/webapp/WEB-INF/mvc-servlet.xml | 6 --- .../src/main/webapp/WEB-INF/view/homepage.jsp | 8 ---- .../src/main/webapp/WEB-INF/view/login.jsp | 26 ------------ .../src/main/webapp/WEB-INF/web.xml | 9 ----- 10 files changed, 12 insertions(+), 97 deletions(-) delete mode 100644 spring-security-custom/src/main/java/org/baeldung/spring/MvcConfig.java delete mode 100644 spring-security-custom/src/main/webapp/WEB-INF/mvc-servlet.xml delete mode 100644 spring-security-custom/src/main/webapp/WEB-INF/view/homepage.jsp delete mode 100644 spring-security-custom/src/main/webapp/WEB-INF/view/login.jsp diff --git a/spring-security-basic-auth/README.md b/spring-security-basic-auth/README.md index 01be5f4b13..95e45ae519 100644 --- a/spring-security-basic-auth/README.md +++ b/spring-security-basic-auth/README.md @@ -6,3 +6,7 @@ ### Relevant Article: - [Spring Security - security none, filters none, access permitAll](http://www.baeldung.com/security-none-filters-none-access-permitAll) - [Spring Security Basic Authentication](http://www.baeldung.com/spring-security-basic-authentication) + + +### Notes +- the project includes both views as well as a REST layer \ No newline at end of file diff --git a/spring-security-custom/.project b/spring-security-custom/.project index 4299cd3728..0e824c1bde 100644 --- a/spring-security-custom/.project +++ b/spring-security-custom/.project @@ -1,6 +1,6 @@ - spring-security-custom + spring-security-rest-custom diff --git a/spring-security-custom/.settings/org.eclipse.wst.common.component b/spring-security-custom/.settings/org.eclipse.wst.common.component index 6322536a9b..3b22cb60bb 100644 --- a/spring-security-custom/.settings/org.eclipse.wst.common.component +++ b/spring-security-custom/.settings/org.eclipse.wst.common.component @@ -1,10 +1,10 @@ - + - - + + diff --git a/spring-security-custom/.springBeans b/spring-security-custom/.springBeans index d11fb034bd..a79097f40d 100644 --- a/spring-security-custom/.springBeans +++ b/spring-security-custom/.springBeans @@ -1,7 +1,7 @@ 1 - + diff --git a/spring-security-custom/pom.xml b/spring-security-custom/pom.xml index ac00c65bbc..1cf7dd867e 100644 --- a/spring-security-custom/pom.xml +++ b/spring-security-custom/pom.xml @@ -2,10 +2,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung - spring-security-custom + spring-security-rest-custom 0.1-SNAPSHOT - spring-security-custom + spring-security-rest-custom war @@ -142,7 +142,7 @@ - spring-security-custom + spring-security-rest-custom src/main/resources diff --git a/spring-security-custom/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-security-custom/src/main/java/org/baeldung/spring/MvcConfig.java deleted file mode 100644 index c76b6175d6..0000000000 --- a/spring-security-custom/src/main/java/org/baeldung/spring/MvcConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.baeldung.spring; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.ViewResolver; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; -import org.springframework.web.servlet.view.InternalResourceViewResolver; -import org.springframework.web.servlet.view.JstlView; - -@Configuration -@EnableWebMvc -public class MvcConfig extends WebMvcConfigurerAdapter { - - public MvcConfig() { - super(); - } - - // API - - @Override - public void addViewControllers(final ViewControllerRegistry registry) { - super.addViewControllers(registry); - - registry.addViewController("/login.html"); - registry.addViewController("/homepage.html"); - } - - @Bean - public ViewResolver viewResolver() { - final InternalResourceViewResolver bean = new InternalResourceViewResolver(); - - bean.setViewClass(JstlView.class); - bean.setPrefix("/WEB-INF/view/"); - bean.setSuffix(".jsp"); - - return bean; - } -} \ No newline at end of file diff --git a/spring-security-custom/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-custom/src/main/webapp/WEB-INF/mvc-servlet.xml deleted file mode 100644 index 5463820874..0000000000 --- a/spring-security-custom/src/main/webapp/WEB-INF/mvc-servlet.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/spring-security-custom/src/main/webapp/WEB-INF/view/homepage.jsp b/spring-security-custom/src/main/webapp/WEB-INF/view/homepage.jsp deleted file mode 100644 index a958bc0a08..0000000000 --- a/spring-security-custom/src/main/webapp/WEB-INF/view/homepage.jsp +++ /dev/null @@ -1,8 +0,0 @@ -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - - - - -

This is the body of the sample view

- - \ No newline at end of file diff --git a/spring-security-custom/src/main/webapp/WEB-INF/view/login.jsp b/spring-security-custom/src/main/webapp/WEB-INF/view/login.jsp deleted file mode 100644 index 013ceccb4e..0000000000 --- a/spring-security-custom/src/main/webapp/WEB-INF/view/login.jsp +++ /dev/null @@ -1,26 +0,0 @@ - - - - -

Login

- -
- - - - - - - - - - - - - -
User:
Password:
- -
- - - \ No newline at end of file diff --git a/spring-security-custom/src/main/webapp/WEB-INF/web.xml b/spring-security-custom/src/main/webapp/WEB-INF/web.xml index e7fbf52aae..372688c8d8 100644 --- a/spring-security-custom/src/main/webapp/WEB-INF/web.xml +++ b/spring-security-custom/src/main/webapp/WEB-INF/web.xml @@ -33,15 +33,6 @@ /api/* - - mvc - org.springframework.web.servlet.DispatcherServlet - 1 - - - mvc - /* -