题
我有一个自定义标签,包装到我的Web应用程序战争文件中包含的库罐中。
我收到以下错误:
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>
但这似乎并没有抱怨在同一taglib中的标签。我已经确认罐子在战争中,标签文件在罐子中,而tld(在meta-inf中)明确定义了“ widgetFactory”
为什么我会遇到这个错误?
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</uri>
<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>
...
解决方案
事实证明,我省略了导入我的标签使用的另一个标签库,因此不会编译。
其他提示
确保您在.tld文件中获得的类名称是正确的。包裹名称中可能有一个错别字,或者班级有不好 package
标题。
不隶属于 StackOverflow