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 (?) |
100 comments:
Thank you very much! This hint was very helpful for me!!
OMG ... two days lost Tnx!
This help me too, thank you
Saved my day! Thanks a lot.
Saved my day! Thanks a lot.
Danke. Habe 1 Tag vergeblich den Fehler gesucht.
Thanks a bunch!!! Saved my bacon!
Thank you!! It drove me to dispair...
Thank u very Much
This site Helps Me thank u very Much
Thanks dude!!! 2 hours left just for uri="http://java.sun.com/jsp/jstl/core" hahahaha
Great. Saved my time too.
Great. Saved my time too.
Another thank you from me. I only besucht den Fehler for four hours, but this was a real lifesaver.
Brilliant, you saved me a lot of pain!
This is great!!!
Thanks a lot.
This really helped me a lot.
This error also happens if you include the tag libraries twice.
I 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
I have wasted 2 days to find the solution for this. Thanks a lot.
thanx for giving solutions for this type of error
thanks
it's work for me
- Joshua
Thank you very much!!!
Thanks buddy. I have already spent 6 hours wasting. Thanks a lot again.
Heck yea, this totally solved my problem. Thanks buddy!
G'day mate.
Saved my day!
Thanks!
Cheers mate. Thanks for your help.
/Andy
thanks
The Force will be with you. :)
Thanks a lot!!!
That was very helpful. Thank you.
Thank you very much - this was exactly the answer I was looking for!
That's works! Thanks!
Thanks
very helpful infomations
thanks very much! i could avoid a ton of frustration.
thx very much
nandx - 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.
Thanks for publishing!
Yet another thank you!
thank you. It helped me to fix.
thank you for the really really useful hint
I highly appreciate your post. It was very helpful.
Thank you so much! great work!
Live long and prosper, my friend.
Great effort i appreciate ur effort
You saved me a lot of time! Thanks a lot from germany!
Thank you for writing that post.
Extemely helpful. Saved my day.
Thank you, I was having this same problem with JSTL Format.
thanks a liot it really helped..awesome
thanku very much
Hi Buddy, Thanks a lot. This information was very useful.
Thanks.. it helped me a lot
hey now we use web-app 2.5.
there 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.
sorry forgot to mention in the previous one....
download jar files @ http://www.jarfinder.com/
Thank you so much man!!!
thanks help a lot!!
It worked ! Just changed taglib uri value and it worked. Thanks a lot.
appriciate!
Thank you very much. its very useful for me. Thank you a lot.
I 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.
Thank you )
Thanks a million!
Thanks very much!!
thanx a Lot man !! :)
Thanks.Your hints helped me to deploy my application successfully
Gr8 seriousli .... helped me save a lot of time...
Danke schön! Thank you!
Thanksss many many times
Great support for all
Thank you! You saved my time...
thanks a lot....it worked for me
Thankyou very much. This saved my time.
Thank you!!!
thank you for http://java.sun.com/jsp/jstl/core
Thank you...It was the link problem.
Thank u. This is a simple solution for my big problem.
Hey this is really helpful thank you very very much ... great
Excellent Solution, Tanks a lot for your correct solution.
Regards
Muthuvel.P
thank you very much for the solution.
Can't fu...g believe...
1 day lost for this.. many thanks. man
it worksssss...nice... :)
i did this
<%@ 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
thanks so much .saved my lot of time.
very useful information
Very useful information.
Should've googled before...
Thanks
Thank you very much.. it help me to save my job.
Thanks a lot for this information. This helped me a lot.
Thank you very very much !!!
wasted 2 days to fix this... This post helped me alott.. thanks...
I owe you a beer!
Thanx for the information,it helps me al lot......
It is very useful. It helps me too. Thank You very much
it solved ma problem .... thanks
Thanks a lot... You saved me!
Spot on! Thank you very much for this!
Such a simple thing, but easy to miss!
Thanks for your gr8 help.
Really appreciable.
thank you very much.i was able to solve the problem.
i 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
Thanks a bunch dude!
saved a day!!
Post a Comment