且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Spring 3安全性j_spring_security_check

更新时间:2022-04-30 23:19:29

您正在尝试根据uri验证uri网页的当前上下文路径。 JSTL标记库可用于确保您可以根据应用程序的上下文轻松生成正确的URL。如果要快速实现,可以使用标记库来完成此操作。为此,您可以将jstl标记库添加到jsp的顶部:

You are trying to validate to a uri based on the current context path of the web page. the JSTL tag lib can be used to ensure you easily generate the correct urls based on the context of the application. You can do this by using a tag library if you want to get it implemented quickly. To do this you can add the jstl tag library to the top of the jsp:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

然后您可以使用以下内容发布到登录servlet。

Then you can use the following to post to the login servlet.

<form action="<c:url value="/j_spring_security_check"></c:url>" method="post" role="form">

这可确保您始终发布到< your_application_context> / j_spring_security_check。

This ensures you alway post to <your_application_context>/j_spring_security_check.

jstl的参考:
http ://docs.oracle.com/javaee/5/jstl/1.1/docs/tlddocs/c/url.html