• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error: package org.apache.taglibs.standard.tag.rt.core does not exist

 
Jason Smit
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting these errors. I am using Apache Tomcat 8.0.9, with Netbeans. I have been trying to use this tutorial:
https://netbeans.org/kb/docs/web/mysql-webapp.html
(However, I am connected to an Oracle Database, not MySQL).

I did a similar setup/deployment on glassfish-4.1 and did not get these issues. It worked there.

If I remove these tags from the jsp file then the errors go away but then I wont get the data displayed from the database.



below is the entire jsp code


Below is the errors:
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your jstl.jar file located? It should be in your Tomcat \lib folder. If it's anywhere else then you have to add it to the Netbeans project as a library.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And btw, using the SQL tags is a Bad Idea except for rapid prototyping. Never do that for production code. Move that database code to a DAO and use a PreparedStatement.
 
Jason Smit
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J. Kevin Robbins wrote:And btw, using the SQL tags is a Bad Idea except for rapid prototyping. Never do that for production code. Move that database code to a DAO and use a PreparedStatement.


Will keep that in mind. Will try that after getting this test project to work.

I have managed to add the libraries as requested to the project so the error is no longer there.
However I am still getting these errors:



 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your URIs are for very very old versions of the JSTL from JSP1.x. Are you sure that's what you want to use?

(Hint: no)
 
Jason Smit
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have added the following jar file to my library but still giving errors:

C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.9\lib\jstl-1.1.2.jar


Should URI link change?

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
 
Jason Smit
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there anyway that I can have someone on Skype to speak to ? It would be great to have a "buddy" to bounce questions and answers via Skype.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be using JSTL 1.2 unless you are using a servlet container that only supports JSP 1.x. Are you? Most probably not. (I see you are using Tomcat 8, which most definitely is not a JSP 1.x container).

Look up info for JSTL 1.2 and make sure you have the right jar files. Using the wrong versions will cause no end of frustrating and hard to debug problems whose error messages will be completely unhelpful.

Do this before you do anything else because nothing is going to work until you do.
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Your URIs are for very very old versions of the JSTL from JSP1.x. Are you sure that's what you want to use?
(Hint: no)

Really?


These look fine to me. They have the /jsp/ section in them which was the difference between JSTL1.0 and JSTL1.1.
I didn't think the URI changed after that.

The error message seems to be coming from an Ant build file - presumably generated by NetBeans.
The build file appears to be pre-compiling your JSPs. (potentially an unnecessary step, as it can compile on the fly, but ok)
You said you changed from using Glassfish to Tomcat.
Have you updated the build file appropriately? What does the build-impl.xml file look like?

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The whole RT thing is a key clue. The RT library was pre-EL.
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>The whole RT thing is a key clue. The RT library was pre-EL.

Yes it was. Though more correctly the EL interpreter library internal to JSTL was pre EL understood by the container
The change in servlet 2.4/JSP2.0 was that EL expressions became runtime expressions.
So now everything uses the RT version of the code.

Prior to this there were two parallel libraries for JSTL
EL - Tags attributes were defined as taking "String". These string expressions were evaluated as EL within JSTL
RT - Tags attributes were defined as taking runtime expressions for those who wanted to use <%= expr %> with their JSTL tags.

As of JSP2.0 EL expressions were understood by the container - in effect they BECAME runtime expressions.
Because this changed the Tag definitions significantly, the introduced the new URI for the tag library - which was effectively the old RT version rebranded.

So the org.apache.taglibs.standard.tag.rt.core package in the generated code is perfectly legitimate.
ALL the tags are now evaluated as runtime expressions.
It's just that we don't often look at the servlet code generated for a JSP.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!