2

I can't seem to get my JSTL library working in my embedded jetty project working.

My taglib line seems to be giving me grief, and it all changes when I use different URIs. Here is the line I would want to use:

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

I first tried using the normal URI http://java.sun.com/jsp/jstl/core but that throws the error:

org.apache.jasper.JasperException: /bad.jsp(1,61) PWC6188: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

However when I change the URI to http://java.sun.com/jstl/core_rt. It works!

Another thing I noticed, if I have the old JSTL 1.0 url (http://java.sun.com/jstl/core) I get the following error:

org.apache.jasper.JasperException: /bad-el.jsp(4,0) PWC6236: According to TLD or attribute directive in tag file, attribute value does not accept any expressions

Now another preplexing thing I have noticed, this all works in IntelliJ! Which leads me to believe that there is a classpath problem, but the libraries should be all the same when I embed them inside the war. I think I am missing something.

So, what my question boils down to, what library do I need, or what configuration do I need to have to make this work properly?

Here are the current questions I have tried to follow but did not resolve my issues:

I have a sample project that one could checkout and try out.

4

1 回答 1

0

如果你想让 JSTL uri 工作,你应该知道 jstl 是两个文件。

  1. jstl-1.2.jar
  2. jstl-api-1.2.jar

所以在互联网上寻找它们或去 maven repo 并下载 jars

于 2020-01-18T09:26:39.077 回答