Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图编写一个自定义 jstl 标记以在标记内使用,它需要访问 modelAttribute 对象的属性。到目前为止,我可以将属性的名称传递给我的标签处理程序,但不知道如何访问 modelAttribute。非常感谢任何帮助!NFV
在自定义标记上创建一个属性,并使用 JSP EL 将其设置为模型属性。
<my:customTag modelprop=${modelPropName}/>
在您的自定义标签中:
<%@ attribute name="modelprop" type="com.x.y.MyObj" %>
value