html - unknown tag c:forEach -
i using <c:foreach>.....</c:foreach>
tag in following .jsp file , receiving "unknown tag c:foreach". using maven , have following dependency included:
<dependency> <groupid>javax.servlet</groupid> <artifactid>jstl</artifactid> <version>1.2</version> </dependency>
and simple .jsp file looks follows:
<%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <body> <h3>gcimage senior design project</h3> <br> <form action="query" method="post" commandname="queryform"> enter sql query: <br> <br> <textarea name="query" path="query" cols="55" rows="3" style="overflow: hidden"></textarea> <br> <input type="submit" value="submit"> </form> <h3>results:</h3> <br> <h5>file paths:</h5> <c:foreach var="individualpath" items="${paths}"> <tr> <td>${individualpath}</td> </tr> </c:foreach> </body> </html>
is there more setup needed jstl? i've read maven dependency should handle everything. appreciated.
found simple answer simple question: need include taglib @ top of .jsp page follows:
<%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <body> <h3>gcimage senior design project</h3> <br> <form action="query" method="post" commandname="queryform"> enter sql query: <br> <br> <textarea name="query" path="query" cols="55" rows="3" style="overflow: hidden"></textarea> <br> <input type="submit" value="submit"> </form> <h3>results:</h3> <br> <h5>file paths:</h5> <c:foreach var="individualpath" items="${paths}"> <tr> <td>${individualpath}</td> </tr> </c:foreach> </body> </html>
Comments
Post a Comment