shiro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdem...@apache.org
Subject [1/2] shiro git commit: Updated Spring examples
Date Tue, 13 Dec 2016 00:36:07 GMT
Repository: shiro
Updated Branches:
  refs/heads/master 9cc88cb60 -> 46bcb3b28


http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/pom.xml
----------------------------------------------------------------------
diff --git a/samples/spring/pom.xml b/samples/spring/pom.xml
index d5257c4..39dafa2 100644
--- a/samples/spring/pom.xml
+++ b/samples/spring/pom.xml
@@ -33,41 +33,27 @@
     <packaging>war</packaging>
     <description>
     	Spring-based web application sample demonstrating Shiro's capabilities. Uses samples-spring module
-    	as the web start application. To launch the webstart application successfully, you need to run 
-    	"mvn jetty:run-exploded", or otherwise make sure the webstart application is available through
-    	web application root context (see the dependency:unpack configure below)
+    	as the web start application.
     </description>
 
     <build>
         <plugins>
             <plugin>
                 <!-- Note	that you need	to run mvn jetty:run-exploded	to test	the	webstart application -->
-                <groupId>org.mortbay.jetty</groupId>
-                <artifactId>maven-jetty-plugin</artifactId>
+                <groupId>org.eclipse.jetty</groupId>
+                <artifactId>jetty-maven-plugin</artifactId>
                 <version>${jetty.version}</version>
                 <configuration>
-                    <contextPath>/shiro-samples-spring</contextPath>
-                    <connectors>
-                        <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
-                            <port>8080</port>
-                            <maxIdleTime>60000</maxIdleTime>
-                        </connector>
-                    </connectors>
-                    <requestLog implementation="org.mortbay.jetty.NCSARequestLog">
-                        <filename>./target/yyyy_mm_dd.request.log</filename>
-                        <retainDays>90</retainDays>
-                        <append>true</append>
-                        <extended>false</extended>
-                        <logTimeZone>GMT</logTimeZone>
-                    </requestLog>
+                    <httpConnector>
+                        <port>8080</port>
+                    </httpConnector>
+                    <webApp>
+                        <contextPath>/shiro-samples-spring</contextPath>
+                        <baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
+                            <resourcesAsCSV>${project.build.directory}/extra/,src/main/webapp</resourcesAsCSV>
+                        </baseResource>
+                    </webApp>
                 </configuration>
-                <dependencies>
-                    <dependency>
-                        <groupId>hsqldb</groupId>
-                        <artifactId>hsqldb</artifactId>
-                        <version>${hsqldb.version}</version>
-                    </dependency>
-                </dependencies>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -89,27 +75,20 @@
                             <type>zip</type>
                         </artifactItem>
                     </artifactItems>
-                    <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
+                    <outputDirectory>${project.build.directory}/extra/WEB-INF/resources</outputDirectory>
                 </configuration>
             </plugin>
             <plugin>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>replace-jnlp-file</id>
-                        <phase>process-resources</phase>
-                        <configuration>
-                            <tasks>
-                                <!-- move would be more appropriate but it would fail on repetitive executions of
-                                     jetty:run for example, leaving the original in place doesn't hurt -->
-                                <copy file="${project.build.directory}/${project.build.finalName}/shiro.jnlp.jsp" todir="${project.build.directory}/${project.build.finalName}/WEB-INF/resources" />
-                            </tasks>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <webResources>
+                        <resource>
+                            <!-- this is relative to the pom.xml directory -->
+                            <directory>${project.build.directory}/extra</directory>
+                        </resource>
+                    </webResources>
+                </configuration>
             </plugin>
         </plugins>
     </build>

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/ApplicationConfig.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/ApplicationConfig.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/ApplicationConfig.java
new file mode 100644
index 0000000..7c79caf
--- /dev/null
+++ b/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/ApplicationConfig.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.shiro.samples.spring.config;
+
+import org.apache.shiro.authc.credential.HashedCredentialsMatcher;
+import org.apache.shiro.cache.ehcache.EhCacheManager;
+import org.apache.shiro.mgt.SecurityManager;
+import org.apache.shiro.samples.spring.BootstrapDataPopulator;
+import org.apache.shiro.samples.spring.DefaultSampleManager;
+import org.apache.shiro.samples.spring.realm.SaltAwareJdbcRealm;
+import org.apache.shiro.spring.config.ShiroAnnotationProcessorConfiguration;
+import org.apache.shiro.spring.config.ShiroBeanConfiguration;
+import org.apache.shiro.spring.remoting.SecureRemoteInvocationExecutor;
+import org.apache.shiro.spring.web.config.DefaultShiroFilterChainDefinition;
+import org.apache.shiro.spring.web.config.ShiroFilterChainDefinition;
+import org.apache.shiro.spring.web.config.ShiroWebConfiguration;
+import org.apache.shiro.spring.web.config.ShiroWebFilterConfiguration;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+
+import javax.sql.DataSource;
+
+import static org.apache.shiro.web.filter.mgt.DefaultFilter.anon;
+
+/**
+ * Application bean definitions.
+ */
+@Configuration
+@PropertySource("classpath:application.properties")
+@Import({ShiroBeanConfiguration.class,
+        ShiroAnnotationProcessorConfiguration.class,
+        ShiroWebConfiguration.class,
+        ShiroWebFilterConfiguration.class,
+        JspViewsConfig.class,
+        RemotingServletConfig.class})
+@ComponentScan("org.apache.shiro.samples.spring")
+public class ApplicationConfig {
+
+
+    /**
+     *Populates the sample database with sample users and roles.
+     * @param dataSource
+     * @return
+     */
+    @Bean
+    protected BootstrapDataPopulator bootstrapDataPopulator(DataSource dataSource) {
+        BootstrapDataPopulator populator =new BootstrapDataPopulator();
+        populator.setDataSource(dataSource);
+        return populator;
+    }
+
+
+    /**
+     * Used by the SecurityManager to access security data (users, roles, etc).
+     * Many other realm implementations can be used too (PropertiesRealm,
+     * LdapRealm, etc.
+     * @param dataSource
+     * @return
+     */
+    @Bean
+    protected SaltAwareJdbcRealm jdbcRealm(DataSource dataSource) {
+
+        HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
+        credentialsMatcher.setHashAlgorithmName("SHA-256");
+        credentialsMatcher.setStoredCredentialsHexEncoded(false);
+
+        SaltAwareJdbcRealm jdbcRealm = new SaltAwareJdbcRealm();
+        jdbcRealm.setName("jdbcRealm");
+        jdbcRealm.setCredentialsMatcher(credentialsMatcher);
+        jdbcRealm.setDataSource(dataSource);
+
+        return jdbcRealm;
+    }
+
+
+    /**
+     * Let's use some enterprise caching support for better performance.  You can replace this with any enterprise
+     * caching framework implementation that you like (Terracotta+Ehcache, Coherence, GigaSpaces, etc
+     *
+     *
+     * @return
+     */
+    @Bean
+    protected EhCacheManager cacheManager() {
+
+        EhCacheManager ehCacheManager = new EhCacheManager();
+
+        // Set a net.sf.ehcache.CacheManager instance here if you already have one.
+        // If not, a new one will be creaed with a default config:
+        // ehCacheManager.setCacheManager(...);
+
+        // If you don't have a pre-built net.sf.ehcache.CacheManager instance to inject, but you want
+        // a specific Ehcache configuration to be used, specify that here.  If you don't, a default
+        //will be used.:
+        // ehCacheManager.setCacheManagerConfigFile("classpath:some/path/to/ehcache.xml");
+
+        return ehCacheManager;
+    }
+
+    /**
+     * Secure Spring remoting:  Ensure any Spring Remoting method invocations can be associated
+     * with a Subject for security checks.
+     * @param securityManager
+     * @return
+     */
+    @Bean
+    protected SecureRemoteInvocationExecutor secureRemoteInvocationExecutor(SecurityManager securityManager) {
+
+        SecureRemoteInvocationExecutor executor = new SecureRemoteInvocationExecutor();
+        executor.setSecurityManager(securityManager);
+
+        return executor;
+    }
+
+
+    /**
+     * Simulated business-tier "Manager", not Shiro related, just an example
+     * @return
+     */
+    @Bean
+    protected DefaultSampleManager sampleManager() {
+        return new DefaultSampleManager();
+    }
+
+    /**
+     * Sample RDBMS data source that would exist in any application - not Shiro related.
+     * @return
+     */
+    @Bean
+    protected DriverManagerDataSource dataSource() {
+
+        DriverManagerDataSource dataSource = new DriverManagerDataSource();
+        dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
+        dataSource.setUrl("jdbc:hsqldb:mem:shiro-spring");
+        dataSource.setUsername("sa");
+
+        return dataSource;
+    }
+
+    @Bean
+    public ShiroFilterChainDefinition shiroFilterChainDefinition() {
+        DefaultShiroFilterChainDefinition chainDefinition = new DefaultShiroFilterChainDefinition();
+//        chainDefinition.addPathDefinition("/login.html", "authc"); // need to accept POSTs from the login form
+//        chainDefinition.addPathDefinition("/logout", "logout");
+
+
+        chainDefinition.addPathDefinition("/favicon.ico", "anon");
+        chainDefinition.addPathDefinition("/logo.png", "anon");
+        chainDefinition.addPathDefinition("/shiro.css", "anon");
+        chainDefinition.addPathDefinition("/s/login", "anon");
+        chainDefinition.addPathDefinition("/*.jar", "anon"); //allow WebStart to pull the jars for the swing app
+        chainDefinition.addPathDefinition("/remoting/**", "anon"); // protected using SecureRemoteInvocationExecutor
+        chainDefinition.addPathDefinition("/**", "authc");
+
+
+        return chainDefinition;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/JspViewsConfig.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/JspViewsConfig.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/JspViewsConfig.java
new file mode 100644
index 0000000..dad47d0
--- /dev/null
+++ b/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/JspViewsConfig.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.shiro.samples.spring.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.web.servlet.ViewResolver;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+import org.springframework.web.servlet.view.InternalResourceViewResolver;
+import org.springframework.web.servlet.view.JstlView;
+
+import static javafx.application.ConditionalFeature.WEB;
+
+/**
+ * JSP / HTML views and resource bean definitions.
+ */
+@Configuration
+@ComponentScan("org.apache.shiro.samples.spring")
+@EnableWebMvc
+public class JspViewsConfig extends WebMvcConfigurerAdapter {
+
+    @Bean
+    @Order(1)
+    public ViewResolver getViewResolver(){
+        InternalResourceViewResolver resolver = new InternalResourceViewResolver();
+        resolver.setViewClass(JstlView.class);
+        resolver.setPrefix("/WEB-INF/resources/");
+        resolver.setSuffix(".jsp");
+        return resolver;
+    }
+
+    @Bean
+    @Order(0)
+    public ViewResolver jnlpViewResolver() {
+        InternalResourceViewResolver resolver = new InternalResourceViewResolver();
+        resolver.setViewClass(JstlView.class);
+        resolver.setPrefix("/WEB-INF/jnlp/");
+        resolver.setSuffix(".jsp");
+        return resolver;
+    }
+
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("*.css", "*.png").addResourceLocations("/");
+        registry.addResourceHandler("*.jar", "*.pack").addResourceLocations("/WEB-INF/resources/");
+    }
+}

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/RemotingServletConfig.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/RemotingServletConfig.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/RemotingServletConfig.java
new file mode 100644
index 0000000..9d79bca
--- /dev/null
+++ b/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/RemotingServletConfig.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.shiro.samples.spring.config;
+
+import org.apache.shiro.samples.spring.SampleManager;
+import org.apache.shiro.spring.remoting.SecureRemoteInvocationExecutor;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter;
+
+/**
+ * Remoting bean definitions.
+ */
+@Configuration
+@ComponentScan("org.apache.shiro.samples.spring")
+public class RemotingServletConfig {
+
+    @Bean(name = "/sampleManager")
+    public HttpInvokerServiceExporter accountServiceExporter(SampleManager sampleManager,
+                                                             SecureRemoteInvocationExecutor secureRemoteInvocationExecutor) {
+
+        HttpInvokerServiceExporter httpInvokerServiceExporter = new HttpInvokerServiceExporter();
+        httpInvokerServiceExporter.setService(sampleManager);
+        httpInvokerServiceExporter.setServiceInterface(SampleManager.class);
+        httpInvokerServiceExporter.setRemoteInvocationExecutor(secureRemoteInvocationExecutor);
+        return httpInvokerServiceExporter;
+    }
+}

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/ServletApplicationInitializer.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/ServletApplicationInitializer.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/ServletApplicationInitializer.java
new file mode 100644
index 0000000..66e503a
--- /dev/null
+++ b/samples/spring/src/main/java/org/apache/shiro/samples/spring/config/ServletApplicationInitializer.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.shiro.samples.spring.config;
+
+import org.springframework.web.WebApplicationInitializer;
+import org.springframework.web.context.ContextLoaderListener;
+import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
+import org.springframework.web.filter.DelegatingFilterProxy;
+import org.springframework.web.servlet.DispatcherServlet;
+import org.springframework.web.util.Log4jConfigListener;
+
+import javax.servlet.DispatcherType;
+import javax.servlet.FilterRegistration;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletRegistration;
+import java.util.EnumSet;
+
+/**
+ * Initializes Spring Environment without the need for a web.xml
+ */
+public class ServletApplicationInitializer implements WebApplicationInitializer {
+
+    @Override
+    public void onStartup(ServletContext container) {
+
+        //now add the annotations
+        AnnotationConfigWebApplicationContext appContext = getContext();
+
+        // Manage the lifecycle of the root application context
+        container.addListener(new ContextLoaderListener(appContext));
+
+        container.addListener(new Log4jConfigListener());
+
+        FilterRegistration.Dynamic shiroFilter = container.addFilter("shiroFilterFactoryBean", DelegatingFilterProxy.class);
+        shiroFilter.setInitParameter("targetFilterLifecycle", "true");
+        shiroFilter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, "/*");
+
+
+        ServletRegistration.Dynamic remotingDispatcher = container.addServlet("remoting", new DispatcherServlet(appContext));
+        remotingDispatcher.setLoadOnStartup(1);
+        remotingDispatcher.addMapping("/remoting/*");
+
+
+        ServletRegistration.Dynamic dispatcher = container.addServlet("DispatcherServlet", new DispatcherServlet(appContext));
+        dispatcher.setLoadOnStartup(1);
+        dispatcher.addMapping("/");
+
+    }
+
+    private AnnotationConfigWebApplicationContext getContext() {
+        AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
+        context.setConfigLocation(getClass().getPackage().getName());
+        return context;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/IndexController.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/IndexController.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/IndexController.java
index 8e87e46..97609db 100644
--- a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/IndexController.java
+++ b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/IndexController.java
@@ -22,14 +22,12 @@ import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.samples.spring.SampleManager;
 import org.apache.shiro.session.Session;
 import org.apache.shiro.subject.Subject;
-import org.springframework.validation.BindException;
-import org.springframework.validation.Errors;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.mvc.SimpleFormController;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.HashMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
@@ -39,7 +37,9 @@ import java.util.Map;
  *
  * @since 0.1
  */
-public class IndexController extends SimpleFormController {
+@Controller
+@RequestMapping("/s/index")
+public class IndexController {
 
     /*--------------------------------------------
     |             C O N S T A N T S             |
@@ -49,6 +49,7 @@ public class IndexController extends SimpleFormController {
     |    I N S T A N C E   V A R I A B L E S    |
     ============================================*/
 
+    @Autowired
     private SampleManager sampleManager;
 
     /*--------------------------------------------
@@ -67,39 +68,44 @@ public class IndexController extends SimpleFormController {
     |               M E T H O D S               |
     ============================================*/
 
-    protected Object formBackingObject(HttpServletRequest request) throws Exception {
-        SessionValueCommand command = (SessionValueCommand) createCommand();
+    @RequestMapping(method = RequestMethod.GET)
+    protected String doGet(Model model) {
 
-        command.setValue(sampleManager.getValue());
-        return command;
+        buildModel(model);
+        model.addAttribute("value", sampleManager.getValue());
+
+        return "sampleIndex";
     }
 
-    protected Map<String, Object> referenceData(HttpServletRequest request, Object command, Errors errors) throws Exception {
+    protected Model buildModel(Model model) {
+
         Subject subject = SecurityUtils.getSubject();
         boolean hasRole1 = subject.hasRole("role1");
         boolean hasRole2 = subject.hasRole("role2");
 
-        Map<String, Object> refData = new HashMap<String, Object>();
-        refData.put("hasRole1", hasRole1);
-        refData.put("hasRole2", hasRole2);
+        model.addAttribute("hasRole1", hasRole1);
+        model.addAttribute("hasRole2", hasRole2);
 
         Session session = subject.getSession();
         Map<Object, Object> sessionAttributes = new LinkedHashMap<Object, Object>();
         for (Object key : session.getAttributeKeys()) {
             sessionAttributes.put(key, session.getAttribute(key));
         }
-        refData.put("sessionAttributes", sessionAttributes);
+        model.addAttribute("sessionAttributes", sessionAttributes);
 
-        refData.put("subjectSession", subject.getSession());
-        return refData;
+        model.addAttribute("subjectSession", subject.getSession());
+        return model;
     }
 
-    protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object obj, BindException errors) throws Exception {
-        SessionValueCommand command = (SessionValueCommand) obj;
+    @RequestMapping(method = RequestMethod.POST)
+    protected String doPost(@RequestParam("value") String newSessionValue, Model model) {
+
+        sampleManager.setValue(newSessionValue);
 
-        sampleManager.setValue(command.getValue());
+        buildModel(model);
+        model.addAttribute("value", sampleManager.getValue());
 
-        return showForm(request, response, errors);
+        return "sampleIndex";
     }
 
 }

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/JnlpController.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/JnlpController.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/JnlpController.java
index 09a7fc2..686ced9 100644
--- a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/JnlpController.java
+++ b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/JnlpController.java
@@ -20,9 +20,13 @@ package org.apache.shiro.samples.spring.web;
 
 import java.util.HashMap;
 import java.util.Map;
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.mvc.AbstractController;
 
@@ -36,6 +40,8 @@ import org.apache.shiro.subject.Subject;
  *
  * @since 0.1
  */
+@Component
+@RequestMapping("/s/shiro.jnlp")
 public class JnlpController extends AbstractController {
 
     /*--------------------------------------------
@@ -45,7 +51,7 @@ public class JnlpController extends AbstractController {
     /*--------------------------------------------
     |    I N S T A N C E   V A R I A B L E S    |
     ============================================*/
-    private String jnlpView;
+    private String jnlpView = "shiro.jnlp";
 
     /*--------------------------------------------
     |         C O N S T R U C T O R S           |
@@ -63,6 +69,7 @@ public class JnlpController extends AbstractController {
     |               M E T H O D S               |
     ============================================*/
 
+    @RequestMapping(method = RequestMethod.GET)
     protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
 
         Subject subject = SecurityUtils.getSubject();

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LoginCommand.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LoginCommand.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LoginCommand.java
deleted file mode 100644
index e818a16..0000000
--- a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LoginCommand.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.shiro.samples.spring.web;
-
-/**
- * Command object that parameters are bound to when logging into the sample
- * application.
- *
- * @since 0.1
- */
-public class LoginCommand {
-
-    /*--------------------------------------------
-    |             C O N S T A N T S             |
-    ============================================*/
-
-    /*--------------------------------------------
-    |    I N S T A N C E   V A R I A B L E S    |
-    ============================================*/
-    private String username;
-    private String password;
-
-    /*--------------------------------------------
-    |         C O N S T R U C T O R S           |
-    ============================================*/
-
-    /*--------------------------------------------
-    |  A C C E S S O R S / M O D I F I E R S    |
-    ============================================*/
-
-    public String getUsername() {
-        return username;
-    }
-
-
-    public void setUsername(String username) {
-        this.username = username;
-    }
-
-
-    public String getPassword() {
-        return password;
-    }
-
-
-    public void setPassword(String password) {
-        this.password = password;
-    }
-
-    /*--------------------------------------------
-    |               M E T H O D S               |
-    ============================================*/
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LoginController.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LoginController.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LoginController.java
index 381802d..95a47a6 100644
--- a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LoginController.java
+++ b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LoginController.java
@@ -23,39 +23,46 @@ import org.apache.shiro.authc.AuthenticationException;
 import org.apache.shiro.authc.UsernamePasswordToken;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.validation.BindException;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.servlet.mvc.SimpleFormController;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import org.springframework.stereotype.Component;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 
 /**
  * Spring MVC controller responsible for authenticating the user.
  *
  * @since 0.1
  */
-public class LoginController extends SimpleFormController {
+@Component
+@RequestMapping("/s/login")
+public class LoginController {
 
     private static transient final Logger log = LoggerFactory.getLogger(LoginController.class);
 
-    protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object cmd, BindException errors) throws Exception {
+    private static String loginView = "login";
+
+    @RequestMapping(method = RequestMethod.GET)
+    protected String view() {
+        return loginView;
+    }
 
-        LoginCommand command = (LoginCommand) cmd;
+    @RequestMapping(method = RequestMethod.POST)
+    protected String onSubmit(@RequestParam("username") String username,
+                              @RequestParam("password") String password,
+                              Model model) throws Exception {
 
-        UsernamePasswordToken token = new UsernamePasswordToken(command.getUsername(), command.getPassword());
+        UsernamePasswordToken token = new UsernamePasswordToken(username, password);
 
         try {
             SecurityUtils.getSubject().login(token);
         } catch (AuthenticationException e) {
             log.debug("Error authenticating.", e);
-            errors.reject("error.invalidLogin", "The username or password was not correct.");
-        }
+            model.addAttribute("errorInvalidLogin", "The username or password was not correct.");
 
-        if (errors.hasErrors()) {
-            return showForm(request, response, errors);
-        } else {
-            return new ModelAndView(getSuccessView());
+            return loginView;
         }
+
+        return "redirect:/s/index";
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LogoutController.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LogoutController.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LogoutController.java
index b4dce7b..7a8b5a8 100644
--- a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LogoutController.java
+++ b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/LogoutController.java
@@ -19,6 +19,9 @@
 package org.apache.shiro.samples.spring.web;
 
 import org.apache.shiro.SecurityUtils;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.mvc.AbstractController;
 
@@ -31,8 +34,11 @@ import javax.servlet.http.HttpServletResponse;
  *
  * @since 0.1
  */
+@Component
+@RequestMapping("/s/logout")
 public class LogoutController extends AbstractController {
 
+    @RequestMapping(method = RequestMethod.GET)
     protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
         SecurityUtils.getSubject().logout();
         return new ModelAndView("redirect:login");

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/RootRedirectController.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/RootRedirectController.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/RootRedirectController.java
new file mode 100644
index 0000000..6f64306
--- /dev/null
+++ b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/RootRedirectController.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.shiro.samples.spring.web;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+/**
+ * Implements the root {@code welcome-file}j as a {@code @RequestMapping}.
+ */
+@Controller
+@RequestMapping({"/"})
+public class RootRedirectController {
+
+    @RequestMapping(method = RequestMethod.GET)
+    public String redirect() {
+        return "redirect:/s/login";
+    }
+}

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/SessionValueCommand.java
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/SessionValueCommand.java b/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/SessionValueCommand.java
deleted file mode 100644
index 4191833..0000000
--- a/samples/spring/src/main/java/org/apache/shiro/samples/spring/web/SessionValueCommand.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.shiro.samples.spring.web;
-
-/**
- * Command object used to bind parameters when submitting a value to be
- * stored in the user's session from the index page.
- *
- * @since 0.1
- */
-public class SessionValueCommand {
-
-    /*--------------------------------------------
-    |             C O N S T A N T S             |
-    ============================================*/
-
-    /*--------------------------------------------
-    |    I N S T A N C E   V A R I A B L E S    |
-    ============================================*/
-    private String value;
-
-    /*--------------------------------------------
-    |         C O N S T R U C T O R S           |
-    ============================================*/
-
-    /*--------------------------------------------
-    |  A C C E S S O R S / M O D I F I E R S    |
-    ============================================*/
-
-    /*--------------------------------------------
-    |               M E T H O D S               |
-    ============================================*/
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-}

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/resources/application.properties
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/resources/application.properties b/samples/spring/src/main/resources/application.properties
new file mode 100644
index 0000000..f78b8fd
--- /dev/null
+++ b/samples/spring/src/main/resources/application.properties
@@ -0,0 +1,28 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Let Shiro Manage the sessions
+shiro.userNativeSessionManager = true
+
+# disable URL session rewriting
+shiro.sessionManager.sessionIdUrlRewritingEnabled = false
+
+shiro.loginUrl = /s/login
+shiro.successUrl = /s/index
+shiro.unauthorizedUrl = /s/unauthorized

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/resources/log4j.properties b/samples/spring/src/main/resources/log4j.properties
index 779033d..829ad67 100644
--- a/samples/spring/src/main/resources/log4j.properties
+++ b/samples/spring/src/main/resources/log4j.properties
@@ -26,7 +26,7 @@ log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m %n
 log4j.logger.org.apache=WARN
 
 # Spring
-log4j.logger.org.springframework=WARN
+log4j.logger.org.springframework=INFO
 
 # Default Shiro logging
 log4j.logger.org.apache.shiro=TRACE

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/webapp/WEB-INF/applicationContext.xml
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/webapp/WEB-INF/applicationContext.xml b/samples/spring/src/main/webapp/WEB-INF/applicationContext.xml
deleted file mode 100644
index c3c116a..0000000
--- a/samples/spring/src/main/webapp/WEB-INF/applicationContext.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<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.0.xsd">
-
-    <!-- Sample RDBMS data source that would exist in any application - not Shiro related. -->
-    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
-        <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
-        <property name="url" value="jdbc:hsqldb:mem:shiro-spring"/>
-        <property name="username" value="sa"/>
-    </bean>
-    <!-- Populates the sample database with sample users and roles. -->
-    <bean id="bootstrapDataPopulator" class="org.apache.shiro.samples.spring.BootstrapDataPopulator">
-        <property name="dataSource" ref="dataSource"/>
-    </bean>
-
-    <!-- Simulated business-tier "Manager", not Shiro related, just an example -->
-    <bean id="sampleManager" class="org.apache.shiro.samples.spring.DefaultSampleManager"/>
-
-    <!-- =========================================================
-         Shiro Core Components - Not Spring Specific
-         ========================================================= -->
-    <!-- Shiro's main business-tier object for web-enabled applications
-         (use DefaultSecurityManager instead when there is no web environment)-->
-    <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
-        <property name="cacheManager" ref="cacheManager"/>
-        <!-- Single realm app.  If you have multiple realms, use the 'realms' property instead. -->
-        <property name="sessionMode" value="native"/>
-        <property name="realm" ref="jdbcRealm"/>
-    </bean>
-
-    <!-- Let's use some enterprise caching support for better performance.  You can replace this with any enterprise
-         caching framework implementation that you like (Terracotta+Ehcache, Coherence, GigaSpaces, etc -->
-    <bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
-        <!-- Set a net.sf.ehcache.CacheManager instance here if you already have one.  If not, a new one
-             will be creaed with a default config:
-             <property name="cacheManager" ref="ehCacheManager"/> -->
-        <!-- If you don't have a pre-built net.sf.ehcache.CacheManager instance to inject, but you want
-             a specific Ehcache configuration to be used, specify that here.  If you don't, a default
-             will be used.:
-        <property name="cacheManagerConfigFile" value="classpath:some/path/to/ehcache.xml"/> -->
-    </bean>
-
-    <!-- Used by the SecurityManager to access security data (users, roles, etc).
-         Many other realm implementations can be used too (PropertiesRealm,
-         LdapRealm, etc. -->
-    <bean id="jdbcRealm" class="org.apache.shiro.samples.spring.realm.SaltAwareJdbcRealm">
-        <property name="name" value="jdbcRealm"/>
-        <property name="dataSource" ref="dataSource"/>
-        <property name="credentialsMatcher">
-            <!-- The 'bootstrapDataPopulator' Sha256 hashes the password
-                 (using the username as the salt) then base64 encodes it: -->
-            <bean class="org.apache.shiro.authc.credential.HashedCredentialsMatcher">
-                <property name="hashAlgorithmName" value="SHA-256"/>
-                <!-- true means hex encoded, false means base64 encoded -->
-                <property name="storedCredentialsHexEncoded" value="false"/>
-            </bean>
-        </property>
-    </bean>
-
-    <!-- =========================================================
-         Shiro Spring-specific integration
-         ========================================================= -->
-    <!-- Post processor that automatically invokes init() and destroy() methods
-         for Spring-configured Shiro objects so you don't have to
-         1) specify an init-method and destroy-method attributes for every bean
-            definition and
-         2) even know which Shiro objects require these methods to be
-            called. -->
-    <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
-
-    <!-- Enable Shiro Annotations for Spring-configured beans.  Only run after
-         the lifecycleBeanProcessor has run: -->
-    <bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"
-          depends-on="lifecycleBeanPostProcessor"/>
-    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
-        <property name="securityManager" ref="securityManager"/>
-    </bean>
-
-    <!-- Secure Spring remoting:  Ensure any Spring Remoting method invocations can be associated
-         with a Subject for security checks. -->
-    <bean id="secureRemoteInvocationExecutor" class="org.apache.shiro.spring.remoting.SecureRemoteInvocationExecutor">
-        <property name="securityManager" ref="securityManager"/>
-    </bean>
-
-    <!-- Define the Shiro Filter here (as a FactoryBean) instead of directly in web.xml -
-         web.xml uses the DelegatingFilterProxy to access this bean.  This allows us
-         to wire things with more control as well utilize nice Spring things such as
-         PropertiesPlaceholderConfigurer and abstract beans or anything else we might need: -->
-    <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
-        <property name="securityManager" ref="securityManager"/>
-        <property name="loginUrl" value="/s/login"/>
-        <property name="successUrl" value="/s/index"/>
-        <property name="unauthorizedUrl" value="/s/unauthorized"/>
-        <!-- The 'filters' property is not necessary since any declared javax.servlet.Filter bean
-             defined will be automatically acquired and available via its beanName in chain
-             definitions, but you can perform overrides or parent/child consolidated configuration
-             here if you like: -->
-        <!-- <property name="filters">
-            <util:map>
-                <entry key="aName" value-ref="someFilterPojo"/>
-            </util:map>
-        </property> -->
-        <property name="filterChainDefinitions">
-            <value>
-                /favicon.ico = anon
-                /logo.png = anon
-                /shiro.css = anon
-                /s/login = anon
-                # allow WebStart to pull the jars for the swing app:
-                /*.jar = anon
-                # everything else requires authentication:
-                /** = authc
-            </value>
-        </property>
-    </bean>
-
-</beans>

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/webapp/WEB-INF/remoting-servlet.xml
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/webapp/WEB-INF/remoting-servlet.xml b/samples/spring/src/main/webapp/WEB-INF/remoting-servlet.xml
deleted file mode 100644
index ac08b71..0000000
--- a/samples/spring/src/main/webapp/WEB-INF/remoting-servlet.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
-
-<!--
-  - Application context definition for "remoting" DispatcherServlet.
-  -->
-<beans>
-
-    <bean name="/sampleManager" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
-        <property name="service" ref="sampleManager"/>
-        <property name="serviceInterface" value="org.apache.shiro.samples.spring.SampleManager"/>
-        <property name="remoteInvocationExecutor" ref="secureRemoteInvocationExecutor"/>
-    </bean>
-
-</beans>

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/webapp/WEB-INF/resources/login.jsp
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/webapp/WEB-INF/resources/login.jsp b/samples/spring/src/main/webapp/WEB-INF/resources/login.jsp
index c1cc7cc..af3531d 100644
--- a/samples/spring/src/main/webapp/WEB-INF/resources/login.jsp
+++ b/samples/spring/src/main/webapp/WEB-INF/resources/login.jsp
@@ -32,9 +32,7 @@
 
     <p>
         <span style="color: red;">
-            <spring:bind path="command.*">
-                ${status.errorMessage}
-            </spring:bind>
+                ${errorInvalidLogin}
         </span>
     </p>
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/webapp/WEB-INF/resources/sampleIndex.jsp
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/webapp/WEB-INF/resources/sampleIndex.jsp b/samples/spring/src/main/webapp/WEB-INF/resources/sampleIndex.jsp
index f81a6ec..a748cfa 100644
--- a/samples/spring/src/main/webapp/WEB-INF/resources/sampleIndex.jsp
+++ b/samples/spring/src/main/webapp/WEB-INF/resources/sampleIndex.jsp
@@ -63,7 +63,7 @@
 
 
     <form action="<c:url value="/s/index"/>" method="POST">
-        Enter value here to store in session: <input type="text" name="value" value="${command.value}" size="30"/>
+        Enter value here to store in session: <input type="text" name="value" value="${value}" size="30"/>
         <input type="submit" value="Save"/>
         <button type="button" onclick="document.location.href='<c:url value="/s/index"/>';">Refresh</button>
     </form>
@@ -71,9 +71,7 @@
 
     <p>
         Click <a href="<c:url value="/s/shiro.jnlp?sessionId=${subjectSession.id}"/>">here</a> to launch webstart
-        application. (Need to be running <span style="font-weight:bold">mvn jetty:run-exploded</span> to have webstart
-        app
-        resources available through the webapp context)
+        application.
     </p>
 
 

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/webapp/WEB-INF/sample-servlet.xml
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/webapp/WEB-INF/sample-servlet.xml b/samples/spring/src/main/webapp/WEB-INF/sample-servlet.xml
deleted file mode 100644
index 055487f..0000000
--- a/samples/spring/src/main/webapp/WEB-INF/sample-servlet.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
-
-<!--
-  - Application context definition for "sample" DispatcherServlet.
-  -->
-
-<beans>
-
-    <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
-        <property name="mappings">
-            <props>
-                <prop key="index">indexController</prop>
-                <prop key="shiro.jnlp">jnlpController</prop>
-                <prop key="login">loginController</prop>
-                <prop key="logout">logoutController</prop>
-                <prop key="unauthorized">loginController</prop>
-            </props>
-        </property>
-    </bean>
-
-    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
-        <property name="viewClass" value="org.springframework.web.servlet.view.InternalResourceView"/>
-        <property name="prefix" value="/WEB-INF/resources/"/>
-        <property name="suffix" value=".jsp"/>
-    </bean>
-
-    <!-- =========================================================
-         Spring controllers
-         ========================================================= -->
-    <bean name="loginController" class="org.apache.shiro.samples.spring.web.LoginController">
-        <property name="commandClass" value="org.apache.shiro.samples.spring.web.LoginCommand"/>
-        <property name="formView" value="login"/>
-        <property name="successView" value="redirect:/s/index"/>
-    </bean>
-
-    <bean name="logoutController" class="org.apache.shiro.samples.spring.web.LogoutController"/>
-
-    <bean id="jnlpController" class="org.apache.shiro.samples.spring.web.JnlpController">
-        <property name="jnlpView" value="shiro.jnlp"/>
-    </bean>
-
-    <bean id="indexController" class="org.apache.shiro.samples.spring.web.IndexController">
-        <property name="commandClass" value="org.apache.shiro.samples.spring.web.SessionValueCommand"/>
-        <property name="formView" value="sampleIndex"/>
-        <property name="successView" value="sampleIndex"/>
-        <property name="sampleManager" ref="sampleManager"/>
-    </bean>
-
-    <bean name="urlController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
-
-</beans>

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/webapp/WEB-INF/web.xml b/samples/spring/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 520c93a..0000000
--- a/samples/spring/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-<web-app version="2.4"
-         xmlns="http://java.sun.com/xml/ns/j2ee"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
-    <!-- ==================================================================
-         Context parameters
-         ================================================================== -->
-    <context-param>
-        <param-name>contextConfigLocation</param-name>
-        <param-value>/WEB-INF/applicationContext.xml</param-value>
-    </context-param>
-
-    <!--
-    - Key of the system property that should specify the root directory of this
-    - web app. Applied by WebAppRootListener or Log4jConfigListener.
-    -->
-    <context-param>
-        <param-name>webAppRootKey</param-name>
-        <param-value>spring-sample.webapp.root</param-value>
-    </context-param>
-
-    <!-- ==================================================================
-         Servlet listeners
-         ================================================================== -->
-    <listener>
-        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
-    </listener>
-    <listener>
-        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
-    </listener>
-
-    <!-- ==================================================================
-         Filters
-         ================================================================== -->
-    <!-- Shiro Filter is defined in the spring application context: -->
-    <filter>
-        <filter-name>shiroFilter</filter-name>
-        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
-        <init-param>
-            <param-name>targetFilterLifecycle</param-name>
-            <param-value>true</param-value>
-        </init-param>
-    </filter>
-
-    <filter-mapping>
-        <filter-name>shiroFilter</filter-name>
-        <url-pattern>/*</url-pattern>
-    </filter-mapping>
-
-    <!-- ==================================================================
-         Servlets
-         ================================================================== -->
-    <servlet>
-        <servlet-name>sample</servlet-name>
-        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-
-    <servlet-mapping>
-        <servlet-name>sample</servlet-name>
-        <url-pattern>/s/*</url-pattern>
-    </servlet-mapping>
-
-    <servlet>
-        <servlet-name>remoting</servlet-name>
-        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-
-    <servlet-mapping>
-        <servlet-name>remoting</servlet-name>
-        <url-pattern>/remoting/*</url-pattern>
-    </servlet-mapping>
-
-    <!-- ==================================================================
-         Welcome file list
-         ================================================================== -->
-    <welcome-file-list>
-        <welcome-file>index.jsp</welcome-file>
-    </welcome-file-list>
-
-</web-app>

http://git-wip-us.apache.org/repos/asf/shiro/blob/46bcb3b2/samples/spring/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/samples/spring/src/main/webapp/index.jsp b/samples/spring/src/main/webapp/index.jsp
deleted file mode 100644
index 152cdc4..0000000
--- a/samples/spring/src/main/webapp/index.jsp
+++ /dev/null
@@ -1,29 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements.  See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership.  The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied.  See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-<%@ page session="false" %>
-<%@ include file="/WEB-INF/resources/include.jsp" %>
-<html>
-<head>
-    <meta http-equiv="Refresh" content="0; url=<c:url value="/s/login"/>">
-</head>
-<body>
-Please wait...
-</body>
-
-</html>
\ No newline at end of file


Mime
View raw message