我用的是struts,自定义了标签库 jsp页面是这样的 <esms:th column="deviceID" bundle="statistic" method="statisticResult"    key="statistic.table.column.deviceID" sort="true" /> esms.tld文件里定义了method属性   <attribute>
   <name>method</name>
   <required>false</required>
   <rtexprvalue>true</rtexprvalue>
  </attribute> .java文件里也定义了String method及其set,get方法 其中在js的function中加了这么一句 alert(method); 目前的情况是这样的 我查看生成页面的源文件 显示的是 alert(statisticResult);而实际上,我onClick,结果显示的却是null我试了其他属性,比如bundle,key什么的都可以正常的alert。。求教大神们,我可能错在什么地方了。。

解决方案 »

  1.   

    你是想执行 statisticResult 这个方法吧?那就不应该使用 alert() 来调用.
      

  2.   


    恩,就是因为不执行,所以我想alert看看method参数是否传入源文件告诉我,已经传入可是实际操作告诉我,没有传入求解。。
      

  3.   

    知道答案了。。低级错误页面下方又有一处引用该标签的时候,没有添加method值所以method给重写成null了。