Java – use spring JSTL and spring form tags together

Can I mix JSTL and spring form tags in JSP pages of spring MVC applications?

<form:form method="POST" action="<c:url value='/j_spring_security_check'/>">
    code
</form:form>

The output is:

<form method="POST" action="<c:url value='/j_spring_security_check'/>">
    code
</form>

The spring tag is being parsed, but the JSTL tag is not being parsed I don't know what I did wrong

Solution

From the accepted answer, link We should not confuse the C: URL tag with the spring form tag, which is illegal You have to

<c:url value="/j_spring_security_check" var="theAction"/>
<form:form method="POST" action="${theAction}">
code
</form:form>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>