我无法插入基本的 HTML 空格而不出现错误。还有其他办法吗?
每当我尝试使用 &nsbp; 时,我都会使用 spring、js 和其他技术来实现。对于空白,它给我以下错误:
Caused by: 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>
</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
I have my implementation with spring, js, and other technologies, whenever i try to use a &nsbp; for white space it gives me the following error:
Caused by: org.apache.jasper.JasperException: /WEB-INF/views/entrada/list.jspx(94,67) The entity "nbsp" was referenced, but not declared.
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
My code:
</td>
<td>
<c:forEach items="${entrada.tags}" var="tag">
<spring:url value="/find/ByTags?tags=${tag.id}" var="buscarTag"/>
<a href="${buscarTag}">${tag}</a>
</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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
尝试将其称为不间断空格的实体编号,
“160”是不间断空格的 Unicode 代码点的编号。您还可以将数字字符引用写为
(同样的事情,但以十六进制表示)
Try referring to it as the entity number for non-breaking space,
"160" is the number of the Unicode code point for non-breaking space. You could also write the numeric character reference as
(same thing, but in hex)
您拼写错误
nbsp
:You misspelled
nbsp
:您是否尝试过将其包装在另一个标签中?
Have you tried wrapping it in another tag?
在我的例子中,只有
标签可以正常在 JSTL 变量之间放置空格。例如:希望它能帮助某人。
In my case only
<c:out>
tag works properly to put space between JSTL-variables. For example:Hope it will help someone.