Can not find the tag library descriptor Error [message #985878] |
Fri, 16 November 2012 14:34 |
Alain L Messages: 4 Registered: November 2012 |
Junior Member |
|
|
Hi there,
This might seem basic, but I am just starting with this, so please bear with me. I am learning JSP, and I am learning about tag libraries, and it doesn't seem to work, and I can't figure out why. I've tried to find and answer, but every solution doesn't seem to work for me...
I am using Eclipse Jave EE IDE version Indigo Service release 2 and my web server is Oracle Web Logic Server 11gR1 (10.3.3)
I've made my tag class that is in a package called "com.tutorialspoint"
package com.tutorialspoint;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import java.io.*;
public class HelloTag extends SimpleTagSupport {
public void doTag() throws JspException, IOException{
JspWriter out = getJspContext().getOut();
out.println("Hello Custom Tag!!!");
}
}
I've made my tag file called custom.tld directly in the WEB-INF folder
<?xml version="1.0" encoding="UTF-8"?>
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>2.0</jsp-version>
<short-name>Example TLD</short-name>
<tag>
<name>Hello</name>
<tag-class>com.tutorialspoint.HelloTag</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
and finally I've made my JSP page
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!-- Declare the custom tag library -->
<%@ taglib prefix="ex" uri="WEB-INF/custom.tld" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http : // www . w3 . org / TR / html4 / loose . dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sample Custom Tag</title>
</head>
<body>
<ex:Hello />
</body>
</html>
The line in bold (<%@ taglib prefix="ex" uri="WEB-INF/custom.tld" %>) is the line in error
"Can not find the tag library descriptor for "WEB-INF/custom.tld""
Can anyone explain to me why this is not working?
[Updated on: Fri, 16 November 2012 14:45] Report message to a moderator
|
|
|
Re: Can not find the tag library descriptor Error [message #985919 is a reply to message #985878] |
Fri, 16 November 2012 16:47 |
|
On 11/16/2012 9:36 AM, Alain L wrote:
> The line in bold (<%@ taglib prefix="ex" uri="WEB-INF/custom.tld" %>) is
> the line in error "Can not find the tag library descriptor for
> "WEB-INF/custom.tld""
>
> Can anyone explain to me why this is not working?
Where did you create the JSP page? Do you have automatic builds
enabled? Does the error go away when you clean and rebuild the project?
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02649 seconds