[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

JSTL 1.0 error

Posted on 2007-10-07
1
Medium Priority
?
1,933 Views
Last Modified: 2013-12-02
Hi,

I have just setup Tomcat tomcat-4.1.36 and trying to start using JSTL 1.0.

I am trying to run the following code:

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<jsp:useBean id="myList" class="java.util.ArrayList"/>
<%
   myList.add("one");
   myList.add("two");
   myList.add("three");
%>
<c:set var="count" value="${fn:length(myList)}"/>
<c:out value="${count}"/> Found    


I have put the *.tld in the WEB-INF directory and have placed the *.jar files into WEB-INF/bin directory.

I have updated my web.xml as follows:

<taglib>
    <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
    <taglib-location>/WEB-INF/c.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/core_rt</taglib-uri>
    <taglib-location>/WEB-INF/c-rt.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
    <taglib-location>/WEB-INF/fmt.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/fmt_rt</taglib-uri>
    <taglib-location>/WEB-INF/fmt-rt.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
    <taglib-location>/WEB-INF/sql.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/sql_rt</taglib-uri>
    <taglib-location>/WEB-INF/sql-rt.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/xml</taglib-uri>
    <taglib-location>/WEB-INF/x.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://java.sun.com/jstl/xml_rt</taglib-uri>
    <taglib-location>/WEB-INF/x-rt.tld</taglib-location>
  </taglib>            


I continue to receive the following error:

org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jsp/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application
      at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:60)
      at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:385)
      at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:109)
      at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:116)
      at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:312)
      at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:339)
      at org.apache.jasper.compiler.Parser.parseElements(Parser.java:749)
      at org.apache.jasper.compiler.Parser.parse(Parser.java:77)
      at org.apache.jasper.compiler.ParserController.parse(ParserController.java:159)
      at org.apache.jasper.compiler.ParserController.parse(ParserController.java:111)
      at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:355)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:427)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:142)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:145)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:139)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2460)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:119)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:955)
      at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:157)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
      at java.lang.Thread.run(Thread.java:595)

Thanks in advance
0
Comment
Question by:dmissel
1 Comment
 
LVL 28

Accepted Solution

by:
rrz earned 2000 total points
ID: 20031459
Why not use Tomcat 6 and JSTL 1.1  ?
Anyway, for 1.0,  instead of
><%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
you need to use
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>  
functions are a feature of 1.1   not 1.0        



0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question