我无法插入基本的HTML空格,而不会收到错误.还有其他的方法吗?

前端之家收集整理的这篇文章主要介绍了我无法插入基本的HTML空格,而不会收到错误.还有其他的方法吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
每当我尝试使用& 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,10)}
         <c:set var="totalHoras" value="${totalHoras+ entrada.horas }"></c:set>bs

解决方法

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

&安培;#160;是一个数字字符引用,可以跨越HTML和XML. &安培; NBSP;是在HTML中定义的character entity reference,而不是XML.您可以将字符引用视为字符的数字表示形式的别名,而在这种情况下(XML),则不会定义别名.

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

原文链接:https://www.f2er.com/html/230737.html

猜你在找的HTML相关文章