jsp - java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String in Struts' logic:equal tag -


i have error when iwant acces jsp page . my bean:

public class bechildren implements serializable { ...  private string isfilledchildren; ....      /**      * @param isfilledchildrenthe isfilledchildrento set      */     public void setisfilledchildren( string isfilledchildren)     {         this.isfilledchildren= isfilledchildren;     }        public string getisfilledchildren( )     {         if ( getnom( ) != null )         {             return "true";         } else         {             return "false";         }     } ... } 

error:

28/07/17-09:13:10,670 error org.apache.struts.taglib.tiles.inserttag - servletexception in '/pages/sub/dir/detail/body.jsp': javax.servlet.jsp.jspexception: invalid argument looking property: "bean.enfant.isfilledchildren" of bean: "sub/dir/detail" org.apache.jasper.jasperexception: javax.servlet.servletexception: javax.servlet.jsp.jspexception: invalid argument looking property: "bean.enfant.isfilledchildren" of bean: "sub/dir/detail"  javax.servlet.jsp.jspexception: invalid argument looking property: "bean.children.isfilledchildren" of bean: "sub/dir/detail"  java.lang.classcastexception: java.lang.boolean cannot cast java.lang.string 

my jsp:

https://pastebin.com/qmgtxbqa

... <html:form action="/page/sub/dir/detail.do"> <html:hidden name="sub/dir/detail" property="modecreation" styleid="modecreation"/> <html:hidden name="sub/dir/detail" property="bean.enfant.isfilledchildren"/> .... <logic:equal name="sub/dir/detail" property="bean.enfant.isfilledchildren" value="true">     ..... </logic:equal> ... <script language="javascript" type="text/javascript">     var f = document.forms[0];      function init(){             var isfilledchildren = document.forms[0].elements["bean.enfant.isfilledchildren"];         ....         if (isfilledchildren!=null && "true"==isfilledchildren.value){         ...         }     } .... 

what wrong ?

the error ecause pass boolean value isfilledchildren property parameter

<logic:equal name="sub/dir/detail" property="bean.enfant.isfilledchildren" value="true"> 

in bean property accepts string value


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -