Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-3181

more background on <<Exception accessing property "prop1" for bean "bean1": java.lang.NoSuchMethodException: Unknown property 'prop1>>'

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Pending Review
    • Component/s: None
    • Labels:
      None
    • Environment:
      java 1.5, any

      Description

      <logic:iterate id="myhashtable" name="myhashtable" scope="session">
      <logic:equal property="prop1" name="myhashtable" scope="session">
      ...

      it works without the logic:equal doesn't have the 'scope="session"'.
      Otherwise, the list elements have the correct bean with a getter for "prop1", but you still see the exception since the logic tag is not accessing the collection element, but the entire collection object

      javax.servlet.jsp.JspException: Exception accessing property "prop1" for bean "bean1": java.lang.NoSuchMethodException: Unknown property 'prop1'
      at org.apache.struts.taglib.logic.CompareTagBase.condition(CompareTagBase.java:191)
      at org.apache.struts.taglib.logic.LessEqualTag.condition(LessEqualTag.java:43)
      at org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag(ConditionalTagBase.java:160)
      at org.apache.jsp.myPage_005fen_jsp._jspx_meth_logic_lessEqual_0(myPage_005fen_jsp.java:7334)
      at org.apache.jsp.myPage_005fen_jsp._jspService(myPage_005fen_jsp.java:2138)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

        Attachments

        1. STR-3181.patch
          2 kB
          Ralf Hauser

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hauser@acm.org Ralf Hauser
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: