13

每当我尝试使用 &nsbp; 时,我都会使用 spring、js 和其他技术来实现。对于空白,它给了我以下错误:

引起:org.apache.jasper.JasperException:/WEB-INF/views/entrada/list.jspx(94,67) 实体“nbsp”被引用,但未声明。

at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
    at org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.java:216)
    at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239)
    at org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:120)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:165)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
    at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:650)
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:644)
    at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103)
    ... 106 more

我的代码:

</td>
        <td>
            <c:forEach items="${entrada.tags}" var="tag">
            <spring:url value="/find/ByTags?tags=${tag.id}" var="buscarTag"/>
                <a href="${buscarTag}">${tag}</a> &nbsp;
            </c:forEach>
        </td>
         <td><input type="hidden" class="horasIn" value="${entrada.horas}"/>
         ${fn:substring(entrada.horas, 0, 10)}
         <c:set var="totalHoras" value="${totalHoras+ entrada.horas }"></c:set>bs
4

4 回答 4

37

尝试将其称为不间断空间的实体编号,&#160;

&#160;是一个数字字符引用,适用于 HTML 和 XML。&nbsp;是在 HTML 但不是 XML 中定义的字符实体引用。您可以将字符引用视为字符数字表示的别名,在这种情况下(XML),恰好没有定义别名。

“160”是不间断空格的 Unicode 代码点的编号。您也可以将数字字符引用写为&#x00a0;(同样的,但使用十六进制)

于 2010-12-04T01:37:31.910 回答
3

你拼错了nbsp

引起:org.apache.jasper.JasperException:/WEB-INF/views/entrada/list.jspx(94,67) 实体“ nsbp ”被引用,但未声明。在 ...

于 2010-12-04T00:22:20.037 回答
0

您是否尝试将其包装在另一个标签中?

<span>&nbsp;</span>
于 2010-12-04T00:18:26.757 回答
0

在我的情况下,只有<c:out>标签才能正常工作,以便在 JSTL 变量之间放置空间。例如:

<c:set var="newVar" >
    <c:out value="${varOne} ${varTwo}" />
</c:set>

希望它会帮助某人。

于 2014-07-09T07:20:25.947 回答