改成type="java.lang.Integer"后,出现下面的错误了[ServletException in:/customer/update.jsp] Unable to compile class for JSP An error occurred at line: 48 in the jsp file: /customer/update.jsp Generated servlet error: [javac] Compiling 1 source file E:\Tomcat 4.1\work\Standalone\localhost\customer\update_jsp.java:188: cannot resolve symbol symbol : method setValue (java.lang.Integer) location: class org.apache.struts.taglib.logic.EqualTag _jspx_th_logic_equal_7.setValue(tempId); ^ 1 error '
<logic:equal name="beanname" property="id" value="???????">把value="????"的双引号,换成 单 引号就好了!
<bean:define id="temId" name="cl" property="id" type="java.lang.String"/>
<logic:equal name="beanname" property="id" value="<%=temId%>"> //比较beanname中的id是否和cl中的id相同,如果相同就显示cl中的name
<bean:write name="cl" property="name"/>
</logic:equal>
</logic:iterate>
<bean:write name="cl" property="id"/>,单独使用这句标签可以正常显示。
<bean:define id="temId" name="cl" property="id" type="java.lang.String"/>
<logic:equal name="beanname" property="id" value="<%=temId%>"> //比较beanname中的id是否和cl中的id相同,如果相同就显示cl中的name
<bean:write name="cl" property="name"/>
</logic:equal>
</logic:iterate> 先定义后使用,肯定是这样!!!我做了3个struts的项目都是这么写的,没见过其他的方法能实现。
怎么为null啊?我bean:write这个值都可以出来。id是一个int类型的,type="java.lang.String"改成了type="int",就报错误。