aspose file tools*
The moose likes JSP and the fly likes JSP XML Compliant does not display loop results Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP XML Compliant does not display loop results" Watch "JSP XML Compliant does not display loop results" New topic
Author

JSP XML Compliant does not display loop results

Clinton Morrison
Greenhorn

Joined: Jun 28, 2007
Posts: 24
Hi,
When the results page is being displayed it does not display the results for ${animals}. It just outputs Could be:. However when I convert it back to a standard jsp it displays ${animals}. I am using Tomcat and jsp version 2.0.

Thanks in advance
Clinton

*results.jsp*
<html xmlns:c="http://java.sun.com/jsp/jstl/core">
<head>
<title>Animal Results</title>
</head>
<body>
<h1>Animal Recommendations JSP</h1>
<table>
<c:forEach var="animals" items="${results}">
<tr>
<td>Could be:<jsp:text>${animals}</jsp:text></td>
</tr>
</c:forEach>
</table>
</body>
</html>

*index.jsp*
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Animal Selection Page</title>
</head>
<body>
<h1 align="center">Animal Selection Page</h1>
<form method="POST" action="SelectAnimal.do">Select animal
characteristics
<p>Color:</p>
<select name="color" size="1">
<option>white</option>
<option>brown</option>
<option>green</option>
<option>orange</option>
</select> <br />
<br />
<center><input type="submit" value="Submit" /></center>
</form>
</body>
</html>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61432
    
  67

Why would you be using the JSP Document Format (XML) instead of the "normal" syntax? The Doc syntax is not intended for hand coding. The markup requirements are too stringent and it's easy to run afoul of them -- as you have discovered.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP XML Compliant does not display loop results