Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't insert a basic HTML whitespace without getting an error. Is there any other way?

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> &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
like image 349
Carlos Sanchez Avatar asked Dec 04 '10 00:12

Carlos Sanchez


People also ask

Can we use &NBSP in HTML?

A commonly used entity in HTML is the non-breaking space: &nbsp; A non-breaking space is a space that will not break into a new line. Two words separated by a non-breaking space will stick together (not break into a new line).

What is a non-breaking space in HTML?

A non-breaking space prevents line breaks from occurring at a particular point in an HTML document. To use a non-breaking space, you would use the following: &nbsp; For example, if you wanted the words "Mr."

What can I use instead of &Nbsp?

In CSS property padding and margin can be used to tab space instead of non-breaking spaces (nbsp).

How Do I Stop &NBSP in HTML?

innerHTML. replace(/&nbsp;/g,'');


1 Answers

Try referring to it as the entity number for non-breaking space, &#160;

&#160; is a numeric character reference and works across HTML and XML. &nbsp; is a character entity reference that is defined in HTML but not XML. You could think of the character reference as an alias to the numeric representation of the character, and in this case (XML) it happens that the alias is not defined.

"160" is the number of the Unicode code point for non-breaking space. You could also write the numeric character reference as &#x00a0; (same thing, but in hex)

like image 163
Ben Regenspan Avatar answered Oct 06 '22 14:10

Ben Regenspan