x-posted to my LJ
So... Still working, (yay) but not got all my references or security gubbins done yet (boo) so I can't do any actual work & am therefore training (yay). I'm learning all about JSPs at the moment, currently by working through "Beginning Java EE 5". It's not bad but tries to cover a LOT of ground very quickly, and I'm left with a little puzzle about JSTL (the Java Standard Tag Library). I'm trying to set it up on my Tomcat 6.0.14 servlet container so thet tha JSTL is automatically available on a server-wide basis. So far I've copied jstl.jar & standard.jar into $CATALINA_HOME/webapps/WEB-INF/lib/, and I've copied ALL the .tld files for c, fmt, fn, sql & x into $CATALINA_HOME/webapps/WEB-INF/tld/ and then added entries for the TLDs into $CATALINA_HOME/webapps/WEB-INF/web.xml thus:
e.g.:
Now, when I have a <c:out value="${var}" /> in a .jsp, I get an error saying:
Does anyone know why that might be? I'm not sure I have JSTL set up right as different websites say to do it differently (to each other, never mind to me). It looks as though JSTL may be getting simpler to implement, like maybe I don't need the web.xml entries or the tld files... Any ideas?
ADDENDUM: I've just had a quick play to experiment, & having deleted the tag llib jars, tlds & lines from web.xml, I find that the <c:forEach> tags around the <c:out> tag still work, and <c:out value="string literal"> works too. The only thing that doesn't work is the <c:out value="${some_expression}" /> tag - it hangs up on the expression.
Does anyone know if JSTL is implemented by default in Tomcat 6.0.14, and how I can get c:out to accept expressions or otherwise get the value of a variable, used in a JSTL tag, output to the browser?
e.g.:
<taglib> <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri> <taglib-location>/WEB-INF/tlds/c.tld</taglib-location> </taglib>
Now, when I have a <c:out value="${var}" /> in a .jsp, I get an error saying:
According to TLD or attribute directive in tag file, attribute value does not accept any expressions.
Does anyone know why that might be? I'm not sure I have JSTL set up right as different websites say to do it differently (to each other, never mind to me). It looks as though JSTL may be getting simpler to implement, like maybe I don't need the web.xml entries or the tld files... Any ideas?
ADDENDUM: I've just had a quick play to experiment, & having deleted the tag llib jars, tlds & lines from web.xml, I find that the <c:forEach> tags around the <c:out> tag still work, and <c:out value="string literal"> works too. The only thing that doesn't work is the <c:out value="${some_expression}" /> tag - it hangs up on the expression.
Does anyone know if JSTL is implemented by default in Tomcat 6.0.14, and how I can get c:out to accept expressions or otherwise get the value of a variable, used in a JSTL tag, output to the browser?
