这是Action中的代码: List <CardInfo> newCardList = this.infoBiz.findNewCard(); ActionMessage newcardName = new ActionMessage( "card.newcardNameandPrice", newCardList);   messages.add("zhnewcardName", newcardName); // 传递国际化消息 
  this.saveMessages(request, messages); 这是页面的代码: <html:messages id="nc" message="true" 
              property="zhnewcardName">       <bean:write name="nc" property="cardName" > </html:messages> <html:messages>标签本身是个迭代标签 为什么在bean:write标签内,加property就出错了。。Exception:No getter method for property: 我换用EL表达式也是一样。${nc.cardName} 

解决方案 »

  1.   

    <html:messages>是你自定义的?... 那你至少要继承下原本的迭代标签的实现类啊..
      

  2.   

    Exception:No getter method for property: 没有定义get方法?
    在nc对象的类中定义一个getCardName()试试
      

  3.   

    cardName这个属性没有定义啊

    <bean:write name="nc" property="cardName" > 应该是
    <bean:write name="nc" property="zhnewcardName" > 吧
      

  4.   

    异常很明显,你要在bean里面getter,setter方法,具体操作就是 private String  变量; 按快捷键,shift+alt+s  弹出菜单,选中getter  setter方法构建,
      

  5.   

    原来html:messages是原本就有的啊...从来木用过..
      

  6.   

    我自己认为是<html:messages>不能循环集合。集合里面是对象,它调用了对象的toString()方法了。所以我用<bean:write>里面的property对应对象中的属性就报这个错了。。
      

  7.   

    如果我直接这样的话<bean:write name="nc" >他是显示出了CardInfo.toString()方法了。。