custom tag in jsp

F

focode

i am working on netbeans ide 6.1 , making a custom JSP tag that will
reverse a string my reverse.tld file is ...

<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-
jsptaglibrary_2_0.xsd">
<tlib-version>1.0</tlib-version>
<short-name>Visualbuilder</short-name>
<uri>/WEB-INF/tlds/reverse</uri>
<info>Visual builder Tag library</info>
<tag>
<name>stringreverse</name>
<tagclass>org.custom.tag.ReverseTag </tagclass>
<info>
This is a simple tag which will reverse the text.
</info>
<!-- Optional attributes -->
</tag>

</taglib>

and my JSP file wher i am implementing it is ....

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="/WEB-INF/tlds/reverse.tld" prefix="reverse" %>

<html>
<head>
<title>Your Custom Tag library</title>
</head>
<body bgcolor="#ffffff">
<hr />
<reverse:stringreverse>
Visual Builder
</reverse:stringreverse>
<hr />
</body>
</html>

on this " customTag.jsp" at <reverse:stringreverse> the ide is telling
me that "NO tag "stringreverse" defined in the library imported with
prefix "reverse"

Kindly help me sort this problem
 
A

Arne Vajhøj

focode said:
i am working on netbeans ide 6.1 , making a custom JSP tag that will
reverse a string my reverse.tld file is ...

<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-
jsptaglibrary_2_0.xsd">
<tlib-version>1.0</tlib-version>
<short-name>Visualbuilder</short-name>
<uri>/WEB-INF/tlds/reverse</uri>
<info>Visual builder Tag library</info>
<tag>
<name>stringreverse</name>
<tagclass>org.custom.tag.ReverseTag </tagclass>
<info>
This is a simple tag which will reverse the text.
</info>
<!-- Optional attributes -->
</tag>

</taglib>

and my JSP file wher i am implementing it is ....

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib uri="/WEB-INF/tlds/reverse.tld" prefix="reverse" %>

<html>
<head>
<title>Your Custom Tag library</title>
</head>
<body bgcolor="#ffffff">
<hr />
<reverse:stringreverse>
Visual Builder
</reverse:stringreverse>
<hr />
</body>
</html>

on this " customTag.jsp" at <reverse:stringreverse> the ide is telling
me that "NO tag "stringreverse" defined in the library imported with
prefix "reverse"

I tried copy paste your TLD and JSP.

It works for me.

Check whether you need to restart some things.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,696
Latest member
BarbraOLog

Latest Threads

Top