This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Mr. Hanna, Followed Your Advice On Custom Tag, Same Error Message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Mr. Hanna, Followed Your Advice On Custom Tag, Same Error Message" Watch "Mr. Hanna, Followed Your Advice On Custom Tag, Same Error Message" New topic
Author

Mr. Hanna, Followed Your Advice On Custom Tag, Same Error Message

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Mr. Hanna, Thank you for taking a look at my code. My tag library descriptor file, csajsp-taglib.tld, was and is under
c:\bea\wlserver6.0sp1
\config\mydomain\applications\DefaultWebApp_myserver\WEB-INF
Pursuant to your comment, my web.xml file looks like:
<?xml version="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<taglib>
<taglib-uri>csajsp-taglib.tld</taglib-uri>
<taglib-location>/WEB-INF/csajsp-taglib.tld</taglib-location>
</taglib>
</web-app>
I typed http://localhost:7001/SimpleExample.jsp in the IE browser, and the error message is the same:
Parsing of JSP File '/SimpleExample.jsp' failed:
/SimpleExample.jsp(6): Could not parse deployment descriptor: java.io.IOException: cannot resolve 'csajsp-taglib.tld' into a valid tag library
probably occurred due to an error in /SimpleExample.jsp line 6:
<%@ taglib uri="csajsp-taglib.tld" prefix="csajsp" %>
Thu Apr 13 19:24:46 EDT 2000
I really don't know what to do. Please help.
Phil Hanna
Ranch Hand

Joined: Apr 05, 2001
Posts: 118
JiaPei, just two more typos to fix in your csajsp-taglib.tld:
1. Remove the space after <! before DOCTYPE.
2. Remove the <urn></urn> line - there is no such element defined in the taglib DTD. It should be <uri></uri> (but you don't need to specify it at all).
I made those two changes and your example is working for me under Tomcat 4.0 beta 3.
------------------
Phil Hanna
Sun Certified Programmer for the Java 2 Platform
Author of :
JSP: The Complete Reference
Instant Java Servlets
Website: http://www.philhanna.com


Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Mr. Hanna, I am glad to know that my very simple custom tag is working on your Tomcat. I followed your instructions:
1. delete the space between ! and DOCTYPE
2. delete <urn></urn>
and my web.xml is
<taglib>
<taglib-uri>csajsp-taglib.tld</taglib-uri>
<taglib-location>/WEB-INF/csajsp-taglib.tld</taglib-location>
</taglib>
I am still getting the same old message:

cannot parse the tag library descriptor file

when running this example on the WebLogic 6.0. I just don't know how to straighten out the problem. Very frustrating.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
JiaPei,
Did this procedure and able to view SimpleExample.jsp. Used Tomcat3.1 on win98. You can also try it.
1. Just create a "tag" dir under your web-appln root.
Example C:\jakarta-tomcat\webapps\MISApp\tags
Here "MISApp" is my web-appn contextName.
2. Copy these 3 file to this "tags" dir.
1) Jsp-Styles.css
2) csajsp-taglib.tld
3) SimpleExample.jsp
C:\jakarta-tomcat\webapps\MISApp\tags\SimpleExample.jsp
C:\jakarta-tomcat\webapps\MISApp\tags\Jsp-Styles.css
C:\jakarta-tomcat\webapps\MISApp\tags\csajsp-taglib.tld
4. Remove all your addtional lines you wrote in web.xml regard to this tag.
3. Just call from browser like this :
http://localhost/MISApp/tags/SimpleExample.jsp
or
http://localhost:8080/MISApp/tags/SimpleExample.jsp
I cut and paste the source also. You can use the same. Give it a try. I didn't make any changes in web.xml.
Meaning , didn't add any modification related to this tag/taglib.


[This message has been edited by maha anna (edited April 26, 2001).]
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I am lucky for having the attention of both Mr. Hanna and Ms. Maha Anna. Ms. Maha Anna, I have tried your method. I placed the JSP, its style sheet, and library descriptor files under the sub-directory of my web application root directory. The error message is the same: cannot parse the library descriptor. By the way, where do you place the compile file ExampleTag.class, of ExampleTag.java? I placed it under the directory in accordance with the WebLogic 6.0 guide.
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Jen,
I am sorry, forgot to mention about ExampleTag.class 's location in previous post. In tomcat I kept it under ....WEB-INF/classes dir.
Since ExampleTag.java has package coreservlets.tags; statement as first line, I created coreservlets\tags dir under ".../WEB-INF/classes" dir and stored like this.
C:\jakarta-tomcat\webapps\MISApp\WEB-INF\classes\coreservlets\tags\ExampleTag.class
Where did you keep this tag handler .class file? It has to be under classpath known to the servlet engine. Did you remove all trace of your modification for this tag in web.xml?
Any web logic users can come forward to help ?
regds
maha anna

regds
maha anna
[This message has been edited by maha anna (edited April 26, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mr. Hanna, Followed Your Advice On Custom Tag, Same Error Message
 
Similar Threads
JSP Custom Tags -- Could Not Parse Deployment Descriptor
Mr. Simon Brown, Could You Help With This Custome Tag Problem?
Problem with custom tags
Mr. Chace, Could You Take A Look At This Tag Library Problem.
Problem running jsps in Weblogic