So I'm trying to make a page that goes into a database and then prints out every result in the resultset as a row in a table. I have it working, but the style is horrible (first time using jsp and just wanted it to function first - all java code is in the jsp file). I know servlets shouldn't be in the jsp for style (or that's what I read...), but it's hard finding an example that follows that rule and helps me understand how the jsp and java file are linked.
So if I have a for loop that assigns a variable "var" based on a result from a resultset, how exactly would I call that from a jsp file? I know there's something like
<c:forEach items="${var}" var="result">
${result.name}
${result.rate}
</c:forEach>
But when I made a small test file, I was getting an error saying c was an unknown tag, so I'm not sure how to resolve that. I'm also not sure how to link the jsp file to the java file so that the function in the file runs and the jsp page knows what ${var} is. Is there supposed to be something in my web.xml file? Any help would be great. Just so great.