Can not find the tag library descriptor Error [message #985878] |
Fri, 16 November 2012 09:34  |
Eclipse User |
|
|
|
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 09:45] by Moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03345 seconds