如果我有现有的 JSP 标记库。在 JSP 中,我可以添加:
<%@taglib uri="http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project/Owasp.CsrfGuard.tld" prefix="csrf" %>
<form>
...
<input type="hidden" name="<csrf:token-name/>" value="<csrf:token-value/>"/>
</form>
这是我尝试添加到 JSF2 分面页面的内容。它不喜欢这样。
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:csrf="http://www.owasp.org/index.php/Category:OWASP_CSRFGuard_Project/Owasp.CsrfGuard.tld">
...
<h:form ...>
....
<input type="hidden" name="#{csrf:token-name}" value="#{csrf:token-value}"/>
</h:form>
甚至有可能做我认为我能做的事情吗?
现在我收到此错误:
javax.servlet.ServletException: Encountered ":" at line 1, column 7.
Was expecting one of:
"}" ...
"." ...
"[" ...
">" ...
"gt" ...
"<" ...
"lt" ...
">=" ...
"ge" ...
"<=" ...
"le" ...
"==" ...
"eq" ...
"!=" ...
"ne" ...
"&&" ...
"and" ...
"||" ...
"or" ...
"*" ...
"+" ...
"-" ...
"/" ...
"div" ...
"%" ...
"mod" ...
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
...