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
Post a Comment