【问题标题】:springframework 'form' tag + spring security authspringframework 'form' 标签 + spring security auth
【发布时间】:2013-07-13 00:05:15
【问题描述】:

我想要什么。我想通过springframework标签'form'来做spring security auth。 示例

<!-- JSP -->
<form:form action="login" commandName="?" >
 <form:errors path="lastError" ></form:errors>
 <form:input path="j_username" />
 <form:password path="j_password" />
 <form:button value="submit" name="submit" />
</form:form>

<!-- security-context.xml -->
<http use-expressions="true">
  <intercept-url pattern="/client/**" access="hasRole('ROLE_USER')" />
  <form-login login-page="/login" login-processing-url="/login"
    authentication-failure-handler-ref="authHandler" />
  <logout logout-url="/logout" logout-success-url="/" />
</http>

应该用什么来代替“?”以 commandName 的形式,或者我该如何做这个狡猾的动作? 感谢您的任何建议。

【问题讨论】:

    标签: spring spring-security jsp-tags


    【解决方案1】:

    在包含 j_username 和 j_password 的 commandName 中放置一个 Loginbean。

    How to make extra validation in Spring Security login form?

    【讨论】:

      猜你喜欢
      • 2016-10-02
      • 2015-10-14
      • 2019-01-20
      • 2018-04-15
      • 2015-08-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-02
      • 2018-04-15
      相关资源
      最近更新 更多