diff --git a/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java b/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java index 2d174fa62e..08e33e5a02 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/DaoAuthenticationProvider.java @@ -20,6 +20,7 @@ import net.sf.acegisecurity.AuthenticationException; import net.sf.acegisecurity.AuthenticationServiceException; import net.sf.acegisecurity.BadCredentialsException; import net.sf.acegisecurity.DisabledException; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.AuthenticationProvider; import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken; import net.sf.acegisecurity.providers.dao.cache.NullUserCache; diff --git a/core/src/main/java/org/acegisecurity/providers/dao/SaltSource.java b/core/src/main/java/org/acegisecurity/providers/dao/SaltSource.java index b5a2e7f592..cfa8ccfe29 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/SaltSource.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/SaltSource.java @@ -15,6 +15,9 @@ package net.sf.acegisecurity.providers.dao; +import net.sf.acegisecurity.UserDetails; + + /** * Provides alternative sources of the salt to use for encoding passwords. * diff --git a/core/src/main/java/org/acegisecurity/providers/dao/UserCache.java b/core/src/main/java/org/acegisecurity/providers/dao/UserCache.java index 7f68d2c46d..8f538cf45f 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/UserCache.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/UserCache.java @@ -15,6 +15,9 @@ package net.sf.acegisecurity.providers.dao; +import net.sf.acegisecurity.UserDetails; + + /** * Provides a cache of {@link User} objects. * diff --git a/core/src/main/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCache.java b/core/src/main/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCache.java index 7586790e1b..5403069e59 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCache.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCache.java @@ -15,8 +15,8 @@ package net.sf.acegisecurity.providers.dao.cache; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.UserCache; -import net.sf.acegisecurity.providers.dao.UserDetails; import net.sf.ehcache.Cache; import net.sf.ehcache.CacheException; diff --git a/core/src/main/java/org/acegisecurity/providers/dao/cache/NullUserCache.java b/core/src/main/java/org/acegisecurity/providers/dao/cache/NullUserCache.java index ed969adbe0..bf3a9cdc65 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/cache/NullUserCache.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/cache/NullUserCache.java @@ -15,8 +15,8 @@ package net.sf.acegisecurity.providers.dao.cache; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.UserCache; -import net.sf.acegisecurity.providers.dao.UserDetails; /** diff --git a/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationEvent.java b/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationEvent.java index 173dce45f4..20a358a1bc 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationEvent.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationEvent.java @@ -16,8 +16,8 @@ package net.sf.acegisecurity.providers.dao.event; import net.sf.acegisecurity.Authentication; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.User; -import net.sf.acegisecurity.providers.dao.UserDetails; import org.springframework.context.ApplicationEvent; diff --git a/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationFailureDisabledEvent.java b/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationFailureDisabledEvent.java index 2d51fb827a..4d7c75ca96 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationFailureDisabledEvent.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationFailureDisabledEvent.java @@ -16,7 +16,7 @@ package net.sf.acegisecurity.providers.dao.event; import net.sf.acegisecurity.Authentication; -import net.sf.acegisecurity.providers.dao.UserDetails; +import net.sf.acegisecurity.UserDetails; /** diff --git a/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationFailurePasswordEvent.java b/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationFailurePasswordEvent.java index 51292957a0..b396c9449e 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationFailurePasswordEvent.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationFailurePasswordEvent.java @@ -16,7 +16,7 @@ package net.sf.acegisecurity.providers.dao.event; import net.sf.acegisecurity.Authentication; -import net.sf.acegisecurity.providers.dao.UserDetails; +import net.sf.acegisecurity.UserDetails; /** diff --git a/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationSuccessEvent.java b/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationSuccessEvent.java index 7024c010f2..f3e0536fe3 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationSuccessEvent.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/event/AuthenticationSuccessEvent.java @@ -16,7 +16,7 @@ package net.sf.acegisecurity.providers.dao.event; import net.sf.acegisecurity.Authentication; -import net.sf.acegisecurity.providers.dao.UserDetails; +import net.sf.acegisecurity.UserDetails; /** diff --git a/core/src/main/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSource.java b/core/src/main/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSource.java index 2703c0c098..3433587151 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSource.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSource.java @@ -16,9 +16,9 @@ package net.sf.acegisecurity.providers.dao.salt; import net.sf.acegisecurity.AuthenticationServiceException; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.SaltSource; import net.sf.acegisecurity.providers.dao.User; -import net.sf.acegisecurity.providers.dao.UserDetails; import org.springframework.beans.factory.InitializingBean; diff --git a/core/src/main/java/org/acegisecurity/providers/dao/salt/SystemWideSaltSource.java b/core/src/main/java/org/acegisecurity/providers/dao/salt/SystemWideSaltSource.java index 32b6176820..974b235013 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/salt/SystemWideSaltSource.java +++ b/core/src/main/java/org/acegisecurity/providers/dao/salt/SystemWideSaltSource.java @@ -15,9 +15,9 @@ package net.sf.acegisecurity.providers.dao.salt; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.SaltSource; import net.sf.acegisecurity.providers.dao.User; -import net.sf.acegisecurity.providers.dao.UserDetails; import org.springframework.beans.factory.InitializingBean; diff --git a/core/src/main/java/org/acegisecurity/userdetails/User.java b/core/src/main/java/org/acegisecurity/userdetails/User.java index 99e911ea34..7e353b8204 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/User.java +++ b/core/src/main/java/org/acegisecurity/userdetails/User.java @@ -16,6 +16,7 @@ package net.sf.acegisecurity.providers.dao; import net.sf.acegisecurity.GrantedAuthority; +import net.sf.acegisecurity.UserDetails; /** diff --git a/core/src/main/java/org/acegisecurity/providers/dao/UserDetails.java b/core/src/main/java/org/acegisecurity/userdetails/UserDetails.java similarity index 80% rename from core/src/main/java/org/acegisecurity/providers/dao/UserDetails.java rename to core/src/main/java/org/acegisecurity/userdetails/UserDetails.java index 7fdb9296af..c3d1daa7e5 100644 --- a/core/src/main/java/org/acegisecurity/providers/dao/UserDetails.java +++ b/core/src/main/java/org/acegisecurity/userdetails/UserDetails.java @@ -13,15 +13,23 @@ * limitations under the License. */ -package net.sf.acegisecurity.providers.dao; +package net.sf.acegisecurity; -import net.sf.acegisecurity.GrantedAuthority; +import net.sf.acegisecurity.providers.dao.User; import java.io.Serializable; /** - * Provides core user information required by the package. + * Provides core user information. + * + *

+ * Implementations are not used directly by Acegi Security for security + * purposes. They simply store user information which is later encapsulated + * into {@link Authentication} objects. This allows non-security related user + * information (such as email addresses, telephone numbers etc) to be stored + * in a convenient location. + *

* *

* Concrete implementations must take particular care to ensure the non-null diff --git a/core/src/main/java/org/acegisecurity/userdetails/UserDetailsService.java b/core/src/main/java/org/acegisecurity/userdetails/UserDetailsService.java index e0e2fde9a8..732446f958 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/UserDetailsService.java +++ b/core/src/main/java/org/acegisecurity/userdetails/UserDetailsService.java @@ -15,6 +15,8 @@ package net.sf.acegisecurity.providers.dao; +import net.sf.acegisecurity.UserDetails; + import org.springframework.dao.DataAccessException; diff --git a/core/src/main/java/org/acegisecurity/userdetails/jdbc/JdbcDaoImpl.java b/core/src/main/java/org/acegisecurity/userdetails/jdbc/JdbcDaoImpl.java index 7ad2341a19..afba107dff 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/jdbc/JdbcDaoImpl.java +++ b/core/src/main/java/org/acegisecurity/userdetails/jdbc/JdbcDaoImpl.java @@ -17,9 +17,9 @@ package net.sf.acegisecurity.providers.dao.jdbc; import net.sf.acegisecurity.GrantedAuthority; import net.sf.acegisecurity.GrantedAuthorityImpl; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.AuthenticationDao; import net.sf.acegisecurity.providers.dao.User; -import net.sf.acegisecurity.providers.dao.UserDetails; import net.sf.acegisecurity.providers.dao.UsernameNotFoundException; import org.apache.commons.logging.Log; diff --git a/core/src/main/java/org/acegisecurity/userdetails/memory/InMemoryDaoImpl.java b/core/src/main/java/org/acegisecurity/userdetails/memory/InMemoryDaoImpl.java index 78979ecad3..64326b0101 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/memory/InMemoryDaoImpl.java +++ b/core/src/main/java/org/acegisecurity/userdetails/memory/InMemoryDaoImpl.java @@ -15,8 +15,8 @@ package net.sf.acegisecurity.providers.dao.memory; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.AuthenticationDao; -import net.sf.acegisecurity.providers.dao.UserDetails; import net.sf.acegisecurity.providers.dao.UsernameNotFoundException; import org.springframework.beans.factory.InitializingBean; diff --git a/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java b/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java index 9f2d1254df..bf184f1693 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java +++ b/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java @@ -15,8 +15,8 @@ package net.sf.acegisecurity.providers.dao.memory; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.User; -import net.sf.acegisecurity.providers.dao.UserDetails; import net.sf.acegisecurity.providers.dao.UsernameNotFoundException; import org.apache.commons.logging.Log; diff --git a/core/src/main/java/org/acegisecurity/userdetails/memory/UserMapEditor.java b/core/src/main/java/org/acegisecurity/userdetails/memory/UserMapEditor.java index c5f73bce40..a9eb6341d1 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/memory/UserMapEditor.java +++ b/core/src/main/java/org/acegisecurity/userdetails/memory/UserMapEditor.java @@ -15,8 +15,8 @@ package net.sf.acegisecurity.providers.dao.memory; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.User; -import net.sf.acegisecurity.providers.dao.UserDetails; import org.springframework.beans.propertyeditors.PropertiesEditor; diff --git a/core/src/test/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulatorTests.java b/core/src/test/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulatorTests.java index 58e32dc41b..f469b83e7f 100644 --- a/core/src/test/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulatorTests.java +++ b/core/src/test/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulatorTests.java @@ -19,9 +19,9 @@ import junit.framework.TestCase; import net.sf.acegisecurity.GrantedAuthority; import net.sf.acegisecurity.GrantedAuthorityImpl; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.AuthenticationDao; import net.sf.acegisecurity.providers.dao.User; -import net.sf.acegisecurity.providers.dao.UserDetails; import net.sf.acegisecurity.providers.dao.UsernameNotFoundException; import org.springframework.dao.DataAccessException; diff --git a/core/src/test/java/org/acegisecurity/providers/dao/DaoAuthenticationProviderTests.java b/core/src/test/java/org/acegisecurity/providers/dao/DaoAuthenticationProviderTests.java index 70048e27a6..b76e737b04 100644 --- a/core/src/test/java/org/acegisecurity/providers/dao/DaoAuthenticationProviderTests.java +++ b/core/src/test/java/org/acegisecurity/providers/dao/DaoAuthenticationProviderTests.java @@ -23,6 +23,7 @@ import net.sf.acegisecurity.BadCredentialsException; import net.sf.acegisecurity.DisabledException; import net.sf.acegisecurity.GrantedAuthority; import net.sf.acegisecurity.GrantedAuthorityImpl; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.TestingAuthenticationToken; import net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken; import net.sf.acegisecurity.providers.dao.cache.EhCacheBasedUserCache; diff --git a/core/src/test/java/org/acegisecurity/providers/dao/UserTests.java b/core/src/test/java/org/acegisecurity/providers/dao/UserTests.java index c37158f020..881d6829d5 100644 --- a/core/src/test/java/org/acegisecurity/providers/dao/UserTests.java +++ b/core/src/test/java/org/acegisecurity/providers/dao/UserTests.java @@ -19,6 +19,7 @@ import junit.framework.TestCase; import net.sf.acegisecurity.GrantedAuthority; import net.sf.acegisecurity.GrantedAuthorityImpl; +import net.sf.acegisecurity.UserDetails; /** diff --git a/core/src/test/java/org/acegisecurity/providers/dao/jdbc/JdbcDaoTests.java b/core/src/test/java/org/acegisecurity/providers/dao/jdbc/JdbcDaoTests.java index 076ba2d306..e6ec1408ee 100644 --- a/core/src/test/java/org/acegisecurity/providers/dao/jdbc/JdbcDaoTests.java +++ b/core/src/test/java/org/acegisecurity/providers/dao/jdbc/JdbcDaoTests.java @@ -17,7 +17,7 @@ package net.sf.acegisecurity.providers.dao.jdbc; import junit.framework.TestCase; -import net.sf.acegisecurity.providers.dao.UserDetails; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.UsernameNotFoundException; import org.springframework.core.io.ClassPathResource; @@ -166,6 +166,20 @@ public class JdbcDaoTests extends TestCase { } } + private DataSource makeDataSource() throws Exception { + ClassPathResource dbScript = new ClassPathResource( + "acegisecuritytest.script"); + String path = dbScript.getFile().getParentFile().getAbsolutePath(); + + DriverManagerDataSource ds = new DriverManagerDataSource(); + ds.setDriverClassName("org.hsqldb.jdbcDriver"); + ds.setUrl("jdbc:hsqldb:" + path + File.separator + "acegisecuritytest"); + ds.setUsername("sa"); + ds.setPassword(""); + + return ds; + } + private JdbcDaoImpl makePopulatedJdbcDao() throws Exception { JdbcDaoImpl dao = new JdbcDaoImpl(); dao.setDataSource(makeDataSource()); @@ -184,20 +198,6 @@ public class JdbcDaoTests extends TestCase { return dao; } - private DataSource makeDataSource() - throws Exception { - ClassPathResource dbScript = new ClassPathResource("acegisecuritytest.script"); - String path = dbScript.getFile().getParentFile().getAbsolutePath(); - - DriverManagerDataSource ds = new DriverManagerDataSource(); - ds.setDriverClassName("org.hsqldb.jdbcDriver"); - ds.setUrl("jdbc:hsqldb:" + path + File.separator + "acegisecuritytest"); - ds.setUsername("sa"); - ds.setPassword(""); - - return ds; - } - //~ Inner Classes ========================================================== private class MockMappingSqlQuery extends MappingSqlQuery { diff --git a/core/src/test/java/org/acegisecurity/providers/dao/memory/UserMapTests.java b/core/src/test/java/org/acegisecurity/providers/dao/memory/UserMapTests.java index c430042fe7..54039e15e0 100644 --- a/core/src/test/java/org/acegisecurity/providers/dao/memory/UserMapTests.java +++ b/core/src/test/java/org/acegisecurity/providers/dao/memory/UserMapTests.java @@ -19,8 +19,8 @@ import junit.framework.TestCase; import net.sf.acegisecurity.GrantedAuthority; import net.sf.acegisecurity.GrantedAuthorityImpl; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.User; -import net.sf.acegisecurity.providers.dao.UserDetails; import net.sf.acegisecurity.providers.dao.UsernameNotFoundException; diff --git a/core/src/test/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSourceTests.java b/core/src/test/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSourceTests.java index 77e1d1f5cb..b646c93ac4 100644 --- a/core/src/test/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSourceTests.java +++ b/core/src/test/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSourceTests.java @@ -20,8 +20,8 @@ import junit.framework.TestCase; import net.sf.acegisecurity.AuthenticationServiceException; import net.sf.acegisecurity.GrantedAuthority; import net.sf.acegisecurity.GrantedAuthorityImpl; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.providers.dao.User; -import net.sf.acegisecurity.providers.dao.UserDetails; /** diff --git a/core/src/test/java/org/acegisecurity/ui/basicauth/BasicProcessingFilterTests.java b/core/src/test/java/org/acegisecurity/ui/basicauth/BasicProcessingFilterTests.java index df21c0d773..a71087f7ed 100644 --- a/core/src/test/java/org/acegisecurity/ui/basicauth/BasicProcessingFilterTests.java +++ b/core/src/test/java/org/acegisecurity/ui/basicauth/BasicProcessingFilterTests.java @@ -24,7 +24,7 @@ import net.sf.acegisecurity.MockFilterConfig; import net.sf.acegisecurity.MockHttpServletRequest; import net.sf.acegisecurity.MockHttpServletResponse; import net.sf.acegisecurity.MockHttpSession; -import net.sf.acegisecurity.providers.dao.UserDetails; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.ui.webapp.HttpSessionIntegrationFilter; import org.apache.commons.codec.binary.Base64; diff --git a/samples/contacts/src/main/java/sample/contact/ContactManagerFacade.java b/samples/contacts/src/main/java/sample/contact/ContactManagerFacade.java index d1f260969a..794e8a8756 100644 --- a/samples/contacts/src/main/java/sample/contact/ContactManagerFacade.java +++ b/samples/contacts/src/main/java/sample/contact/ContactManagerFacade.java @@ -17,9 +17,9 @@ package sample.contact; import net.sf.acegisecurity.AccessDeniedException; import net.sf.acegisecurity.Authentication; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.context.ContextHolder; import net.sf.acegisecurity.context.SecureContext; -import net.sf.acegisecurity.providers.dao.UserDetails; import org.springframework.beans.factory.InitializingBean; diff --git a/samples/contacts/src/main/java/sample/contact/ContactSecurityVoter.java b/samples/contacts/src/main/java/sample/contact/ContactSecurityVoter.java index 4b69c5efac..8189a6a8c9 100644 --- a/samples/contacts/src/main/java/sample/contact/ContactSecurityVoter.java +++ b/samples/contacts/src/main/java/sample/contact/ContactSecurityVoter.java @@ -18,7 +18,7 @@ package sample.contact; import net.sf.acegisecurity.Authentication; import net.sf.acegisecurity.ConfigAttribute; import net.sf.acegisecurity.ConfigAttributeDefinition; -import net.sf.acegisecurity.providers.dao.UserDetails; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.vote.AccessDecisionVoter; import org.aopalliance.intercept.MethodInvocation; diff --git a/samples/contacts/src/main/java/sample/contact/SecureIndexController.java b/samples/contacts/src/main/java/sample/contact/SecureIndexController.java index 441586bf98..6b25ede3ba 100644 --- a/samples/contacts/src/main/java/sample/contact/SecureIndexController.java +++ b/samples/contacts/src/main/java/sample/contact/SecureIndexController.java @@ -18,9 +18,9 @@ package sample.contact; import net.sf.acegisecurity.Authentication; import net.sf.acegisecurity.AuthenticationCredentialsNotFoundException; import net.sf.acegisecurity.GrantedAuthority; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.context.ContextHolder; import net.sf.acegisecurity.context.SecureContext; -import net.sf.acegisecurity.providers.dao.UserDetails; import org.springframework.beans.factory.InitializingBean; diff --git a/samples/contacts/src/main/java/sample/contact/WebContactAddController.java b/samples/contacts/src/main/java/sample/contact/WebContactAddController.java index 6ae84c3539..f26613611c 100644 --- a/samples/contacts/src/main/java/sample/contact/WebContactAddController.java +++ b/samples/contacts/src/main/java/sample/contact/WebContactAddController.java @@ -16,9 +16,9 @@ package sample.contact; import net.sf.acegisecurity.Authentication; +import net.sf.acegisecurity.UserDetails; import net.sf.acegisecurity.context.ContextHolder; import net.sf.acegisecurity.context.SecureContext; -import net.sf.acegisecurity.providers.dao.UserDetails; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.SimpleFormController;