0

我正在尝试将 Apache Struts 与 BootStrap css 一起使用,它使用自定义 css 属性data-toggle="dropdown"作为其菜单。

我试过了

<html:link action="/Home" styleClass="dropdown-toggle" data-toggle="dropdown">
                    <bean:message key="menu.person" />
</html:link>

但是data-toggle="dropdown"不允许,在 NetBeans 中它会给出错误:

Attribute data-toggle invalid for tag link according to TLD

如何将自定义属性放在一个data-toggle内部<html:link>

到目前为止,我只能看到 id 和 class 属性是允许的。

4

1 回答 1

0

什么版本?IIRC 更高版本的 S1 允许任意属性,但我必须仔细检查。

如果无法升级,请提取 TLD 并对其进行修改以允许 JSP 2.0 下的任意属性:

<dynamic-attributes>true</dynamic-attributes>
于 2013-06-18T13:15:05.123 回答