tags:

views:

239

answers:

2

I have a custom tag, packaged into a library jar that is included in my web apps war file.

I get the following error:

An error occurred at line: 66 in the jsp file: /WEB-INF/jsp/portlet/portfolio/operations/operationsInfo.jsp
org.apache.jsp.tag.meta.form.WidgetFactory_tag cannot be resolved to a type
63:       <c:forEach var="fldCfg" items="${config.page.fields}" >
64:          <tr>
65:             <td><form:Label fld="${fldCfg}"/></td>
66:             <td><form:WidgetFactory fld="${fldCfg}" decodesMap="${decodesMap}" command="${operationsInfoBean}" dateFormat="${preferredDateFormat}"/></td>
67:          </tr>
68:       </c:forEach>
69:   </table>

But it doesn't seem to complain about Label which is in the same taglib. I've confirmed that the jar is in the war and that the tag file is in the jar and the that the TLD (in META-INF) expressly defines 'WidgetFactory'

Why am I getting this error?

TLD snippit:

<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>Form</short-name>
<uri>http://web.foo.com/tags/form&lt;/uri&gt;
<description>Tags that encapsulate the Aladdin form elements, both basic and widgets</description>

<tag-file>
    <description>Factory to select the correct widget type</description>
    <name>WidgetFactory</name>
    <path>/META-INF/tags/form/WidgetFactory.tag</path>
</tag-file>

...

A: 

Make sure that the class name you've got in your .tld file is correct. Possibly there's a typo in the package name somewhere, or maybe the class has a bad package header.

Pointy
It's not a class, it's a .tag file, so no package name to mess up...
Matthew Smith
Ah. Well, I'm not sure what's happening; it seems a little weird to me that you'd call out "jsp-version" as 1.2, when to my knowledge tag files are a jsp 2.0 feature. I have no idea whether that would have any effect.
Pointy
A: 

Turns out I had omitted importing another Tag library being used by my tag, so it wouldn't compile.

Matthew Smith