代码之家  ›  专栏  ›  技术社区  ›  xain

struts-bean属性没有getter方法

  •  0
  • xain  · 技术社区  · 15 年前

    我有一个带有JSP的Struts应用程序,代码是:

    <input name="inrofol" class="inputfilter" id="inrofol" size="22" maxlength="20" type="text">
    

    尽管它没有链接到相关联的表单bean,但我得到了一个例外:

    错误500:bean的属性“inrofol”没有getter方法: “com.test.forms.compform”

    有什么暗示吗?谢谢

    2 回复  |  直到 8 年前
        1
  •  1
  •   user159088    15 年前

    这个 bean的属性“inrofol”没有getter方法:“com.test.forms.compform” 消息来自 org.apache.struts.taglib.TagUtils . 没有其他类会抛出这种消息。

    但是,由于tagutils只是为struts JSP标记提供了helper方法,这意味着一些struts标记正在某处使用“inrofol”字段,并试图在bean中查找它。

    您确定“inrofol”只用于JSP中的这段代码吗?

    <input name="inrofol" class="inputfilter" id="inrofol" size="22" maxlength="20" type="text">
    

    检查你的 valComp.jsp 文件。

        2
  •  0
  •   Karthik    15 年前

    请检查吸气剂和setter是否正确设置。

    同样,在支柱样式中也有表单标签

    <html:form>.