Compile JSP tomcat JSTL error "According to TLD or attribute directive in tag file, attribute value does not accept any expressions"
Problem:
Compile error from tomcat when it encounters a JSP: "According to TLD or attribute directive in tag file, attribute value does not accept any expressions"
Solution:
For some reason the JSP is using the 1.2 JSP (and 1.0 JSTL) and EL expressions aren't understood. There's a lot of hits on the web for this but in summary there are 2 important things to do to ensure you're getting the right version of the spec:
- Reference the correct servlet specification in your deployment descriptor:
<?xml version="1.0"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- Reference the correct JSTL uri in your JSP:
change<%@ taglib uri='http://java.sun.com/jstl/core' prefix='c'%>
to<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
Notes:
What Specification goes with what? | |||
Web-app(deployment schema) | 2.3 | 2.4 | 2.5 |
http://java.sun.com/dtd/web-app_2_3.dtd | http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd | http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd | |
Servlet | 2.3 | 2.4 | 2.5 |
JSP | 1.2 | 2.0 | 2.1 |
JSTL(core uri reference) | 1.0 | 1.1 | 1.2 |
http://java.sun.com/jstl/core | http://java.sun.com/jsp/jstl/core | http://java.sun.com/jsp/jstl/core | |
Tomcat | 4.x | 5.x | 6.x |
WebSphere | 5.x | 6.x | 7.x (?) |
Thank you very much! This hint was very helpful for me!!
ReplyDeleteOMG ... two days lost Tnx!
ReplyDeleteThis help me too, thank you
ReplyDeleteSaved my day! Thanks a lot.
ReplyDeleteSaved my day! Thanks a lot.
ReplyDeleteDanke. Habe 1 Tag vergeblich den Fehler gesucht.
ReplyDeleteThanks a bunch!!! Saved my bacon!
ReplyDeleteThank you!! It drove me to dispair...
ReplyDeleteThank u very Much
ReplyDeleteThis site Helps Me thank u very Much
ReplyDeleteThanks dude!!! 2 hours left just for uri="http://java.sun.com/jsp/jstl/core" hahahaha
ReplyDeleteGreat. Saved my time too.
ReplyDeleteGreat. Saved my time too.
ReplyDeleteAnother thank you from me. I only besucht den Fehler for four hours, but this was a real lifesaver.
ReplyDeleteBrilliant, you saved me a lot of pain!
ReplyDeleteThis is great!!!
ReplyDeleteThanks a lot.
This really helped me a lot.
This error also happens if you include the tag libraries twice.
ReplyDeleteI had the same problem with one include which I forgot to delete that had the directives for including the libraries.
Thanx alot i spent half day to find out solution but didn,t get ur trick worked for me it saves lot of time thanx again
ReplyDeleteI have wasted 2 days to find the solution for this. Thanks a lot.
ReplyDeletethanx for giving solutions for this type of error
ReplyDeletethanks
ReplyDeleteit's work for me
- Joshua
Thank you very much!!!
ReplyDeleteThanks buddy. I have already spent 6 hours wasting. Thanks a lot again.
ReplyDeleteHeck yea, this totally solved my problem. Thanks buddy!
ReplyDeleteG'day mate.
ReplyDeleteSaved my day!
Thanks!
Cheers mate. Thanks for your help.
ReplyDelete/Andy
thanks
ReplyDeleteThe Force will be with you. :)
ReplyDeleteThanks a lot!!!
ReplyDeleteThat was very helpful. Thank you.
ReplyDeleteThank you very much - this was exactly the answer I was looking for!
ReplyDeleteThat's works! Thanks!
ReplyDeleteThanks
ReplyDeletevery helpful infomations
thanks very much! i could avoid a ton of frustration.
ReplyDeletethx very much
ReplyDeletenandx - indonesia
Yes, that helped me also! You would think that servlet containers/jsp compilers could be a little more helpful when reporting these sorts of issues.
ReplyDeleteThanks for publishing!
Yet another thank you!
ReplyDeletethank you. It helped me to fix.
ReplyDeletethank you for the really really useful hint
ReplyDeleteI highly appreciate your post. It was very helpful.
ReplyDeleteThank you so much! great work!
ReplyDeleteLive long and prosper, my friend.
ReplyDeleteGreat effort i appreciate ur effort
ReplyDeleteYou saved me a lot of time! Thanks a lot from germany!
ReplyDeleteThank you for writing that post.
ReplyDeleteExtemely helpful. Saved my day.
ReplyDeleteThank you, I was having this same problem with JSTL Format.
ReplyDeletethanks a liot it really helped..awesome
ReplyDeletethanku very much
ReplyDeleteHi Buddy, Thanks a lot. This information was very useful.
ReplyDeleteThanks.. it helped me a lot
ReplyDeletehey now we use web-app 2.5.
ReplyDeletethere we can use
xml version="1.0" encoding="UTF-8"
web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5"
in the web.xml as the schema and we can use the taglib
@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
in this way.This is also working.....
and please put the relevant greater and lesser than marks in appropriate places.
hey please use the jstl-1.2.jar.
ReplyDeletesorry forgot to mention in the previous one....
download jar files @ http://www.jarfinder.com/
Thank you so much man!!!
ReplyDeletethanks help a lot!!
ReplyDeleteIt worked ! Just changed taglib uri value and it worked. Thanks a lot.
ReplyDeleteappriciate!
ReplyDeleteThank you very much. its very useful for me. Thank you a lot.
ReplyDeleteI can't believe it took me half a day to fix this. Thanks for this post. The problem with tomcat/spring/jstl stuff is that there're so many outdated blogs/tips/tutorial out there that're totally misleading.
ReplyDeleteThank you )
ReplyDeleteThanks a million!
ReplyDeleteThanks very much!!
ReplyDeletethanx a Lot man !! :)
ReplyDeleteThanks.Your hints helped me to deploy my application successfully
ReplyDeleteGr8 seriousli .... helped me save a lot of time...
ReplyDeleteDanke schön! Thank you!
ReplyDeleteThanksss many many times
ReplyDeleteGreat support for all
ReplyDeleteThank you! You saved my time...
ReplyDeletethanks a lot....it worked for me
ReplyDeleteThankyou very much. This saved my time.
ReplyDeleteThank you!!!
ReplyDeletethank you for http://java.sun.com/jsp/jstl/core
ReplyDeleteThank you...It was the link problem.
ReplyDeleteThank u. This is a simple solution for my big problem.
ReplyDeleteHey this is really helpful thank you very very much ... great
ReplyDeleteExcellent Solution, Tanks a lot for your correct solution.
ReplyDeleteRegards
Muthuvel.P
thank you very much for the solution.
ReplyDeleteCan't fu...g believe...
ReplyDelete1 day lost for this.. many thanks. man
it worksssss...nice... :)
ReplyDeletei did this
ReplyDelete<%@ page isELIgnored ="false" %>
<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
i just used these and web xml was still at 2.3 spec and
lib had to jars
jstl.jar
standard.jar
but i guess the tag lib decl modification helped a ton
thank you so much
screwed for 2 days. finally got it. very useful post
ReplyDeletethanks so much .saved my lot of time.
ReplyDeletevery useful information
Very useful information.
ReplyDeleteShould've googled before...
Thanks
ReplyDeleteThank you very much.. it help me to save my job.
ReplyDeleteThanks a lot for this information. This helped me a lot.
ReplyDeleteThank you very very much !!!
ReplyDeletewasted 2 days to fix this... This post helped me alott.. thanks...
ReplyDeleteI owe you a beer!
ReplyDeleteThanx for the information,it helps me al lot......
ReplyDeleteIt is very useful. It helps me too. Thank You very much
ReplyDeleteit solved ma problem .... thanks
ReplyDeleteThanks a lot... You saved me!
ReplyDeleteSpot on! Thank you very much for this!
ReplyDeleteSuch a simple thing, but easy to miss!
Thanks for your gr8 help.
ReplyDeleteReally appreciable.
thank you very much.i was able to solve the problem.
ReplyDeletei am using netbeans 7.0 my
web-app version 3.0 .hence i have to go for jstl 1.1 or higher,when i add it to my project solved the problem .once agin thank you very much.sir.
thanks your tutorial helped me lot to figure out the issue.once agina thnak you
ReplyDeleteThanks a bunch dude!
ReplyDeletesaved a day!!
ReplyDelete