1

我见过几个例子使用

 <a href="<spring:url value='/about/' />" >About </a>

我试试这个并从 Jetty 得到一个错误

Caused by: org.apache.jasper.JasperException: /WEB-INF/views/footer.jspx(6,22) The value of attribute "href" associated with an element type "null" must not contain the '<' character.

是否有一些我忽略的编码设置?

这很不幸,因为我见过的其他使用 spring url 的例子很丑

<spring:url value='/about' var="about_url" />
<a href="${about_url}" title="About MyFit">About MyFit</a>

我真的需要为模板中的每个超链接添加一行吗?

这是相当微不足道而我忽略的事情吗?

4

1 回答 1

2

您有一个.jspx文件,该文件必须是格式良好的 XML 文档。在.jsp文件中它可以正常工作。

于 2010-06-25T17:58:20.030 回答