html - jstl forEach not printing array elements on different lines -


on .jsp page trying iterate through array , print each out on new line. works each element of array printed on same line. have tried both of following 2 methods , neither work:

 <c:foreach var="individualpath" items="${paths}">     <tr>         <td>${individualpath}<br></td>     </tr>     <br> </c:foreach> 

and

<c:foreach var="individualpath" items="${paths}"> <c:out value="${individualpath}" />     <p> </c:foreach>  

have tried using java/jsp instead of jstl follows:

<c:foreach var="individualpath" items="${paths}">     <c:out value="${individualpath}" />     <%         out.print("\n");     %> </c:foreach> 

have tried using <pre></pre> tags preserve whitespace same erroneous outcome: both of paths condensed onto single line

`<pre><c:foreach var="path" items="${paths}">${path}<br/></c:foreach></pre>` 

help appreciated

i tried in case,it working expected.lets have @ code

<table border="1">       <h3>from 1 10</h3>       <c:foreach var="i" begin="1" end="10">         <tr>         <td>${i}<br></td>         </tr>       </c:foreach> </table> 

i looked source of page per expectation.

<table border="1">           <h3>from 1 10</h3>              <tr>             <td>1<br></td>             </tr>              <tr>             <td>2<br></td>             </tr>              <tr>             <td>3<br></td>             </tr>              <tr>             <td>4<br></td>             </tr>              <tr>             <td>5<br></td>             </tr>              <tr>             <td>6<br></td>             </tr>              <tr>             <td>7<br></td>             </tr>              <tr>             <td>8<br></td>             </tr>              <tr>             <td>9<br></td>             </tr>              <tr>             <td>10<br></td>             </tr>      </table> 

check source how getting converted , share us.may can give pointer start.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -