我有一个自定义按钮标签来处理我的功能,我想要一些来自 struts bean 标签的值来实现我的功能。我在我的自定义标签中嵌套了 struts 标签。
我在 JSP 中的代码如下所示。
<button:button module="MyModule" subModule="MySubModule" aliasType="ButtonType" aliasName="SaveButtonGroup"
onClick="addNewPart('<bean:Write property="paymentNumber" name="payment" />','<bean:Write property="transactionId" name="payment" />') </button:button>
但是,我在运行时收到以下错误
weblogic.servlet.jsp.CompilationException: Failed to compile JSP /JSP/cdr/tdsDetails.jsp
tdsDetails.jsp:1:1: The page failed validation from validator: "org.xml.sax.SAXParseException: Attribute "name" was already specified for element "button:button".".
tdsDetails.jsp:308:59: This attribute is not recognized.
onClick="addNewPart('<bean:Write property="paymentNumber" name="payment" />','<bean:Write property="transactionId" name="payment" />');"></button:button>
解决方案是什么?在此先感谢您的帮助。