天天看點

You must specify the value attribute or nested tag

關鍵字: specify attribute nested

2008-4-7 16:41:19 org.apache.catalina.core.ApplicationDispatcher invoke

嚴重: Servlet.service() for servlet jsp threw exception

javax.servlet.jsp.JspException: You must specify the value attribute or nested tag content

 at org.apache.struts.taglib.html.MultiboxTag.prepareValue(MultiboxTag.java:201)

 at org.apache.struts.taglib.html.MultiboxTag.doEndTag(MultiboxTag.java:170)

.......

這個錯誤是由于<html:multibox這個标簽空所緻

Html代碼

You must specify the value attribute or nested tag
  1. <html:multibox property="kk_CheckBox">  
  2.        <bean:write name="element" property="idbmqx" />  
  3.       </html:multibox>  
<html:multibox property="kk_CheckBox">
       <bean:write name="element" property="idbmqx" />
      </html:multibox>
           

如果idbmqx為空,那麼就會報異常的,解決辦法就是不要讓multibox 為空,或者用<c:if控制一下,為空就不執行

Html代碼

You must specify the value attribute or nested tag
  1. <logic:notEmpty name="element" property="idbmqx">  
  2.       <html:multibox property="kk_BlacklistVehicle_UserManage_BMQX_SC_CheckBox">  
  3.        <bean:write name="element" property="idbmqx" />  
  4.       </html:multibox>  
  5.      </logic:notEmpty>  
<logic:notEmpty name="element" property="idbmqx">
      <html:multibox property="kk_BlacklistVehicle_UserManage_BMQX_SC_CheckBox">
       <bean:write name="element" property="idbmqx" />
      </html:multibox>
     </logic:notEmpty>

           

 <logic:notEmpty 非空判斷,不為空時才執行标簽體裡的内容