• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

using custom tags & tag handler class - URGENT

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
Here is my .tld file :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag
Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.0</jspversion>
<shortname>TAG LIBRARY</shortname>
<tag>
<name>listEvent</name>
<tagclass>
EventHandler
</tagclass>
<bodycontent>JSP</bodycontent>
<attribute>
<name>dt</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>
AND here is JSP where I'm using this library
<%@ page language="java" session="true" autoFlush="true" import="java.util.*" %>
<%@ taglib prefix="events" uri="/myLibrary" %>
<html>
<body>
<events:listEvent dt="05/29/2002"> hello </events:listEvent>
HELLO
</body>
</html>
I made an entry into web.xml saying :
<taglib>
<taglib-uri>/myLibrary</taglib-uri>

<taglib-location>
/WEB-INF/classes/listEvents.tld
</taglib-location>
</taglib>
Now when I invoking JSP file, its giving me this error :
javax.servlet.ServletException: Parse Error in JSP page: The tag handler class '
EventHandler
' for custom tag 'listEvent' on line '5' could not be found.
I dont know why The tag handler class is not being located. I have put both .tld file and the EventHandler file in the same dir under WEB-INF/classes. ?? Pls. help.
[ May 22, 2002: Message edited by: Sam Cala ]
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sam
Try with following:
First replace
<tagclass>
EventHandler
</tagclass>
with
<tag-class>
EventHandler
</tag-class>

second create a folder \WEB-INF\classes\test and put
package test;
on top of your EventHandler.java
recompile and replace
<tag-class>
EventHandler
</tag-class>
with
<tag-class>
test.EventHandler
</tag-class>
Hoping this will help you.
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did the same thing and got the following exception :
null
java.lang.NullPointerException
at allaire.jrun.servlet.JRunServletLoader.getClassBytes(JRunServletLoader.java:619)
at allaire.jrun.servlet.JRunServletLoader.loadClass(JRunServletLoader.java:515)
at allaire.jrun.servlet.JRunServletLoader.loadClass(JRunServletLoader.java:444)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at allaire.jrun.servlet.JRunSE.loadClass(JRunSE.java:1367)
at allaire.jrun.jsp.JSPParser.action(JSPParser.java:941)
at allaire.jrun.jsp.JSPParser.parse(JSPParser.java:602)
at allaire.jrun.jsp.JSPParser.writeXML(JSPParser.java:151)
at allaire.jrun.jsp.JSPParser.generateXML(JSPParser.java:123)
at allaire.jrun.jsp.JSPParser.generateXML(JSPParser.java:67)
at allaire.jrun.jsp.JSPServlet.parsePage(JSPServlet.java:409)
at allaire.jrun.jsp.JSPServlet.createServlet(JSPServlet.java:381)
at allaire.jrun.jsp.JSPServlet.loadPage(JSPServlet.java:202)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:169)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)
HELP
 
Younas Aamir
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sam
I was supposing that you are using Tomcat. The error shows that you are using JRun, for JRun 3.1 your first setting is quite good. Would you please like to tell me which JRun you are using?
[ May 22, 2002: Message edited by: Younas Aamir ]
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
U have mentioned that u have put .tld file in /WEB-INF/classes directory but I find this
<taglib-location>
/WEB-INF/classes/com/net4india/planner/event/listEvents.tld
</taglib-location>
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Younas,
I'm using JRun 3.0 Enterprise Edition.
Pradeep, that line has been edited. Both files (.tld & .class are in the same dir)
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But if in .tld file, I replace <tag-class> with <tagclass> and run, then it gives me the following error :
javax.servlet.ServletException: Parse Error in JSP page: The tag handler class '
EventHandler
' for custom tag 'listEvent' on line '5' could not be found.
allaire.jrun.jsp.ParseException: The tag handler class '
EventHandler
' for custom tag 'listEvent' on line '5' could not be found.
at allaire.jrun.jsp.JSPParser.action(JSPParser.java:944)
at allaire.jrun.jsp.JSPParser.parse(JSPParser.java:602)
at allaire.jrun.jsp.JSPParser.writeXML(JSPParser.java:151)
at allaire.jrun.jsp.JSPParser.generateXML(JSPParser.java:123)
at allaire.jrun.jsp.JSPParser.generateXML(JSPParser.java:67)
at allaire.jrun.jsp.JSPServlet.parsePage(JSPServlet.java:409)
at allaire.jrun.jsp.JSPServlet.createServlet(JSPServlet.java:381)
at allaire.jrun.jsp.JSPServlet.loadPage(JSPServlet.java:202)
at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:169)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
at allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
at allaire.jrun.WorkerThread.run(WorkerThread.java:75)

Even though EventHandler.class is lying at WEB-INF/classes, than why its not being able to be located ?? Pls. help.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
plz import the class in ur JSP.
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pradeep,
It gives the same error even after i import class file in JSP. Even i have tried to instantiate it using <jsp:useBean/> but its purposeless...
 
Younas Aamir
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sam
try to remove this line from your /WEB-INF/classes/listEvents.tld file

<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag
Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
It was bug in JRun 3.0 and was fixed in JRun 3.1
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still there is not any difference...
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can u paste all ur files here.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are u able to run the example that comes with JRun?
 
reply
    Bookmark Topic Watch Topic
  • New Topic