Migration Solutions for ColdFusion Applications to ASP.NET
      
New Atlanta Product Forums Profile | Search | Login | RSS
New Topic Reply   Previous Page  Page: 1   Next Page

Thread: Error referencing tag files within a tag file:
Created on: 04/11/11 02:21 PM Replies: 1
cpdjh02


Joined: 04/08/11
Posts: 17
Error referencing tag files within a tag file:
04/11/11 2:21 PM

I have two .tag files located in the WEB-INF/tags directory (testTag.tag and SecondTagTest.tag)

The contents of testTag.tag are very simple:
This is a test tag.


Then in my SecondTagTest.tag file I try and use the first tag:
<%@ taglib tagdir="/WEB-INF/tags" prefix="testTags" %>

This is my second test tag.

<testTags:testTag/>


And when I try and use my second tag in a JSP file like so:
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>

<%@ taglib tagdir="/WEB-INF/tags" prefix="testTags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>

<title>Test for tagdir tags.</title>   

</head>

<body>

This is my JSP page.

   <testTags:SecondTagTest/>

<br>

</body>

</html>

I get errors like the following:
JspServlet: action testTag is not defined in TLD for tag library testTags

a SimpleTag cannot have a body-content of JSP.

the problem occurred around line number 4 in file C:\Program Files\New Atlanta\ServletExec AS\se-serveletexec\webapps\default\TagDirTest\WEB-INF\tags\SecondTagTest.tag:

[<testTags:testTag/> ]

the problem occurred around line number 2 in file C:\Program Files\New Atlanta\ServletExec AS\se-serveletexec\webapps\default\TagDirTest\tagTest.jsp:

[<%@ taglib tagdir="/WEB-INF/tags" prefix="testTags" %>]
Link | Top | Bottom
paulbonfanti


Joined: 10/04/07
Posts: 451
RE: Error referencing tag files within a tag file:
04/13/11 2:55 PM

I've entered this as bug #3399. The workaround is to:

1. Move testTag.tag to /WEB-INF/tags/subDir.
2. Change SecondTagTest.tag to the following:

<%@ taglib tagdir="/WEB-INF/tags/subDir"
prefix="testTagsSubDir" %> This is my second test tag.
<testTagsSubDir:testTag/>

Note that the taglib prefix must be different from the taglib prefix used in the JSP page.
Paul Bonfanti, New Atlanta
Link | Top | Bottom

New Post
Please login to post a response.


company media information terms of use privacy policy contact us
This page was dynamically built on the BlueDragon CFML Engine