• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1246
  • Last Modified:

problem with core_rt

Hi all,

Please help ...

The following is my setting -

Path: Tommcat5.5\webapps\test\WEB-INF
test folder contains WEB-INF and request.jsp
WEB-INF contains classes, lib, tld folders, and web.xml.

classes folder is empty.
lib folder contains jstl.jar, standard.jar, ...

tld folder contains c.tld, c-rt.tld, fmt.tld, fmt-rt.tld, sql.tld, sql-rt.tld, x.tld, and x-rt.tld

request.jsp:

<%@ taglib uri="http://java.sun.com/jst1/core_rt" prefix="c_rt" >
<html>
    <body>
        You sent the following request headers:
        <br />
        <table border="1">
         <tr><th>Header</th><th>Value</th></tr>
         <c:forEach var="entry" items="${header}">
         <tr>
         <td>${entry.key}</td>
         </tr>
         </c:forEach>
        </table>
     </body>
</html>
---------------------------------------------------------------------------------------------------------------------------------------

web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app 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"
    version="2.4">

<taglib>
      <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
      <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib>

<taglib>
      <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
      <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
</taglib>

<taglib>
      <taglib-uri>http://java.sun.com/jstl/xml</taglib-uri>
      <taglib-location>/WEB-INF/tld/x.tld</taglib-location>
</taglib>

<taglib>
      <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
      <taglib-location>/WEB-INF/tld/sql.tld</taglib-location>
</taglib>

</web-app>
-------------------------------------------------------------------------------------------------------------------------------
After entered http://localhost:8080/test/request.jsp at the URL and pushed enter, the error message shown as below -

-------------------------------------------------------------------------------
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jst1/core_rt cannot be resolved in either web.xml or the jar files deployed with this application
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
=========================================================================

:(


0
guochu
Asked:
guochu
  • 2
  • 2
  • 2
  • +3
5 Solutions
 
suprapto45Commented:
Hi,

You do not have c_rt in your lib, do you?
<%@ taglib uri="http://java.sun.com/jst1/core_rt" prefix="c_rt" >

instead, you have c JSTL in your lib so you can change it into
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" >

David
0
 
suprapto45Commented:
If you want to use c_rt, you need to add it to your web.xml first.

David
0
 
gksinghietCommented:
In request.jsp use
<%@ taglib uri="http://java.sun.com/jst1/core" prefix="c" >
instead of
<%@ taglib uri="http://java.sun.com/jst1/core_rt" prefix="c_rt" >
in your JSP.
uri should be the one which is deployed in web.xml, as use deployed core tags with uri 'http://java.sun.com/jst1/core'
you should use the same URI
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
boonlengCommented:
Typo error:
<%@ taglib uri="http://java.sun.com/jst1/core_rt" prefix="c_rt" >

should be http://java.sun.com/jstl/core_rt, is 'l' not '1'.
0
 
rrzCommented:
Which version of the jars did you download ?  Why not get 1.1.2  ?
0
 
guochuAuthor Commented:
Hi all,

Thanks for replying my question.

>>>>  You do not have c_rt in your lib, do you?
>>>>  <%@ taglib uri="http://java.sun.com/jst1/core_rt" prefix="c_rt" >

I have these files c.tld, c-rt.tld, fmt.tld, fmt-rt.tld, sql.tld, sql-rt.tld, x.tld, and x-rt.tld in the tld folder.


>>>>    instead, you have c JSTL in your lib so you can change it into
>>>>   <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" >

I have tried it, but didn't work.


>>>>  If you want to use c_rt, you need to add it to your web.xml first.

Are you refering to core_rt or c-rt? I don't have core_rt.tld inside the tld folder. Where can I download it? If I have this core_rt, then I need to add it to web.xml, right?

Am my syntax rigjt?
<taglib>
      <taglib-uri>http://java.sun.com/jstl/core_rt</taglib-uri>
      <taglib-location>/WEB-INF/tld/core_rt.tld</taglib-location>
</taglib>

or
<taglib>
      <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
      <taglib-location>/WEB-INF/tld/core_rt.tld</taglib-location>
</taglib>

>>>>  In request.jsp use
>>>>  <%@ taglib uri="http://java.sun.com/jst1/core" prefix="c" >
>>>>  instead of
>>>>  <%@ taglib uri="http://java.sun.com/jst1/core_rt" prefix="c_rt" >
>>>>  in your JSP.
>>>>  uri should be the one which is deployed in web.xml, as use deployed core tags with
>>>>  uri 'http://java.sun.com/jst1/core'
>>>>  you should use the same URI

I have tried <%@ taglib uri="http://java.sun.com/jst1/core" prefix="c" >, but didn't work.

Can anyone give me one working version?

Thanks for reading :)

0
 
guochuAuthor Commented:
>>>   Which version of the jars did you download ?  Why not get 1.1.2  ?

version 1.0
0
 
rrzCommented:
Why not get 1.1.2  ?  
It is easier. The tlds are in the jars and you don't have to worry about them.
0
 
evnafetsCommented:
In fact if you have a JSP2.0 container (like Tomcat 5) and are using the version 2.4 web.xml (which you are) you CAN'T use JSTL1.0 - it is incompatible.

My suggestions
- remove all that taglib crap from your web.xml file.
- delete all the tld files.
- download JSTL1.1 (http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi)
- import with the following urls in all your JSP pages: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  - note the addition of the "/jsp" in there.
  - also note that it is JSTL, not JST1 (it is the letter 'l', not the number '1' which you have in some of the code above)

0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now