Link to home
Start Free TrialLog in
Avatar of guochu
guochu

asked on

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)
=========================================================================

:(


Avatar of suprapto45
suprapto45
Flag of Singapore image

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
ASKER CERTIFIED SOLUTION
Avatar of suprapto45
suprapto45
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rrz
Which version of the jars did you download ?  Why not get 1.1.2  ?
Avatar of guochu
guochu

ASKER

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 :)

Avatar of guochu

ASKER

>>>   Which version of the jars did you download ?  Why not get 1.1.2  ?

version 1.0
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial