我有一个包含电子邮件地址和密码的登录页面。我如何使用spring security来进行安全登录?我不明白该怎么做..?在我的Web应用程序中,第一页是带有userEmail和Password的登录页面。如何在登录表单中添加弹簧安全
这是我的jsp页面
<form:form action="/pname/signin" modelAttribute="user" method="post" id="form" >
<form:input path="userEmailId" placeholder="User Name" />
<form:password path="userPassword" placeholder="Password" />
<a href="signin" class="anchorStyle"><input type="submit" value="signin"/> </a>
</form:form>
,这里是我的弹簧security.xml文件
<http auto-config="true">
<intercept-url pattern="/**" access="ROLE_ADMIN" />
<logout logout-success-url="/signin?logout" />
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="user" password="password" authorities="ROLE_ADMIN" />
</user-service>
</authentication-provider>
</authentication-manager>
请告诉我,我的错误是。成功登录后,它也应该进入hello页面。
你可以添加显示表单的JSP吗? – Jeroen 2014-09-03 10:03:58
@ Jeroen..i增加了它..请告诉我..我使用json为此.. – ghhhhhhhh 2014-09-03 10:25:41
你能描述什么不工作?你到达登录页面吗?尝试进行身份验证时是否会遇到任何异常? – Jeroen 2014-09-03 11:19:57