• Post Reply Bookmark Topic Watch Topic
  • New Topic

jstl question  RSS feed

 
John Gregory
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, want to create a jsp that prints out pizza toppings somebody
selects from a form. I got this to work using scripting, but then,
I found out I can use jstl foreach. However, on my jsp, the taglib
statement is underlined in red.

I am using netbeans ide. I copied the jstl.jar file into the lib directory
and even created a lib directory under WEB-INF and copied the jstl.jar
file there, as well. Yet, when I select some toppings and try to display
them, I get some big old exception.

Here's what my jsp looks like:

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<c:forEach var="topping" items="toppings">
<br>${topping}
</c:forEach>

Now, I know I don't need to put anything in my web.xml file, so I'm
not sure what could be wrong. The HF book doesn't really give any
more hints than what I've mentioned.

If anyone has any ideas, I'm all ears!

Thanks,

John
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't used Netbeans in a long time, but last time I did, I had to 'mount' each jar file that I wanted included in my project.

Are you sure that Netbeans knows about the jars that you put into the lib directory?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you put standard.jar?
 
John Gregory
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben,

I figured it out. I forgot to add the jstl library to the
library node (right click library and add library...jstl was
there). I just copied jar file like the head first book suggested.
It now prints out what I was expecting.

John
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!