Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Newb taglib conceptual error: Missing tagclass for tag "dbgrid"

Thread view: 
geoffalot - 28 May 2007 19:58 GMT
Newb Taglib conceptual error:
"Missing tagclass for tag 'dbgrid'"

I am attempting to integrate a datagrid taglib into a small test
application.

The Datagrid lives here:
http://www.codeproject.com/useritems/DBGrid.asp?df=100&forumid=82119&fr=26

My .jsp starts with the following:

<%@ taglib uri="/WEB-INF/tags/datagrid.tld" prefix="grd" %>

<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="com.freeware.gridtag.*" %>

The taglib section from my web.xml looks like this:

<taglib>
<taglib-uri>/tags/datagrid.tld</taglib-uri>
<taglib-location>/WEB-INF/tags/datagrid.tld</taglib-location>
</taglib>

(The file datagrid.tld definitely lives under /WEB-INF/tags)

My datagrid taglib descriptor starts like this:

<taglib>
 <tlib-version>1.0</tlib-version>
 <jsp-version>1.2</jsp-version>
 <short-name>DBGrid</short-name>
 <display-name>DBGrid</display-name>
 <small-icon>images/dbGridS.gif</small-icon>
 <large-icon>images/dbGridM.gif</large-icon>
 <description>JSP Data Grid Tag Library</description>

 <tag>
   <name>dbgrid</name>
   <tag-class>com.freeware.gridtag.DBGrid</tag-class>

The error I am receiving on the jsp is:
dg.jsp Line 1: Missing tagclass for tag "dbgrid"

In the .jsp, I can import all the classes in datagrid.tld with "@ page
import" directives, but something I am doing wrong is making it
impossible to for the application to "see" the tagclasses via a
taglib.

If it matters - I am running this on Blazix.

Any help greatly appreciated.

Geoff
angrybaldguy@gmail.com - 28 May 2007 21:01 GMT
> Newb Taglib conceptual error:
> "Missing tagclass for tag 'dbgrid'"

Which means the web app can't locate the class for that tag.  Imports
have nothing to do with it; you'll need to either include the taglib
JAR in WEB-INF/lib or include the classes in WEB-INF/classes, or
otherwise make the DataGridTag classes and their dependencies
available to the web app's classloader.
geoffalot - 28 May 2007 21:34 GMT
On May 28, 1:01 pm, angrybald...@gmail.com wrote:
> > Newb Taglib conceptual error:
> > "Missing tagclass for tag 'dbgrid'"
[quoted text clipped - 4 lines]
> otherwise make the DataGridTag classes and their dependencies
> available to the web app's classloader.

I have the dbgrid-1.0.4.jar in the WEB-INF/lib directory, which is why
this is so vexxing to me :)
When you say "imports have nothing to do with it" - does that  mean
even though a class is available via an import, it isn't necessarily
visible to the web application context?
Lew - 29 May 2007 02:25 GMT
angrybald...@gmail.com wrote:
>> Which means the web app can't locate the class for that tag.  Imports
>> have nothing to do with it;

> When you say "imports have nothing to do with it" - does that  mean
> even though a class is available via an import, it isn't necessarily
> visible to the web application context?

That is correct.  In fact, an "import" is necessarily not visible at runtime.

Bear in mind that "import" does not exist in the bytecode; it is a convenience
for the compiler only.  What exists in the bytecode is a fully-qualified class
name every time.

At the (run-) time of first use, a class must be "brought in" to the JVM.
This is done through a ClassLoader.  If the ClassLoader cannot find the class,
there is a runtime error.  (Runtime errors can never have anything to do with
"import" because "import" is a compile-time concept.)

For a web app, the ClassLoader class path is as angrybaldguy described.

All "import" does is, in effect, a text translation of an unqualified class
name to a fully-qualified class name.  It does nothing to guarantee runtime
availability of that fully-qualified class.

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.