You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marty Fisher <mf...@systemslink.com> on 2001/03/16 14:19:21 UTC

Missing Property

Hi,

Can a second pair of eyes point out the problem with the iterate and form code
below:

The jsp code:

          <jsp:useBean id="jobQueueForm" type="JobQueueForm" />

          <logic:iterate id="list" name="jobQueueForm" property="JqRow">
                 <bean:write name="list" />
          </logic:iterate>

The form code:

          public String [] getJqRow ()
         {
                   .
                   .
                   .
         }

The error:

         javax.servlet.jsp.JspException: No getter method for bean jobQueueForm
and property JqRow


Other jsps use different properties of the form with no problem.  Any
suggestions ?

Marty Fisher


Populating ActionForm

Posted by Frank Ling <st...@hotmail.com>.
Hi, There:

Here is the some question I have for the from populating, This maybe a
stupid question.

In the my simple search functionality Project.

I have the form-action combination as following.

PaymentSearchAction    PaymentSearchForm

DisplayStmAction          DisplayStmForm

in the PaymentSearchForm I take in all the search conditions, like
consultant name, stating date, ending date etc, then PaymentSearchAction
will perform the search and get all the result set in the session, then I
need populate all the result to DisplayStmForm, based on the setting in
struts-config.xml,  DisplayStmAction is the guy can access DisplayStmForm,
then the question is How DisplayStmAction can take control from this point
automaticlly, then I can populate the DisplayStmForm.

By another word, how can I jump from paymentSearchAction to DisplayStmAction
automatically, then I can use PaymentSearchAction populate PaymentSearchForm
to do the search then automatically switch to DisplayStmAction to populate
DisplayStmForm for the display.

Thanks

Frank Ling

Re: Missing Property

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 16 Mar 2001, Marty Fisher wrote:

> I cleared up the 500 error below by enclosing the bean:write with a logic:present tag.
> As a newbie I'm happy to get it working and am interested in why it does.
> 
>       <logic:iterate id="list" name="jobQueueForm" property="JqRow">
>             <logic:present name="list" >
>                  <bean:write name="list" />
>             </logic:present>
>       </logic:iterate>
> 

Does your String array have any null values in it?  There is an
outstanding bug report about that right now.

Also, at one point the <logic:iterate> tag had a bug where it did not
actually expose the loop control variable ("list" in your example) to the
rest of the page.  This was fixed several weeks ago, but if your copy of
Struts is quite old it may still have this problem.

> Thanks
> 

Craig


Re: Missing Property

Posted by Marty Fisher <mf...@systemslink.com>.
I cleared up the 500 error below by enclosing the bean:write with a logic:present tag.
As a newbie I'm happy to get it working and am interested in why it does.

      <logic:iterate id="list" name="jobQueueForm" property="JqRow">
            <logic:present name="list" >
                 <bean:write name="list" />
            </logic:present>
      </logic:iterate>

Thanks

Marty Fisher wrote:

> Thanks, that did the trick - sort of.  There is the correct amount of data being
> displayed and then an usuall error.
>
>      1 U COMMAND1 2000-01-01 00:00:00.0 2000-01-01 00:00:00.0 P mfisher 2000-01-01
> 00:00:00.0 N 0 0 0 LOG 2
>
>      500 Internal Server Error
>
>      /struts/jobQueue.do:
>
>      javax.servlet.ServletException: Exception thrown processing JSP page.
>      javax.servlet.jsp.JspException: No bean found for attribute key list
>
> If no bean can be found, where did the '1 U COMMAND1 ...' come from ?.  That line is
> the correct contents of the String [] jqRow property.  It looks like the iterate
> choked when it ran out of data.  Is that possible ?
>
> Thanks again,
> Marty Fisher
>
> Jean-Noel Ribette wrote:
>
> > > The jsp code:
> > >
> > >           <jsp:useBean id="jobQueueForm" type="JobQueueForm" />
> > >
> > >           <logic:iterate id="list" name="jobQueueForm" property="JqRow">
> > >                  <bean:write name="list" />
> > >           </logic:iterate>
> > >
> > > The form code:
> > >
> > >           public String [] getJqRow ()
> > >          {
> > >                    .
> > >                    .
> > >                    .
> > >          }
> > >
> > > The error:
> > >
> > >          javax.servlet.jsp.JspException: No getter method for bean jobQueueForm
> > > and property JqRow
> > >
> > >
> > > Other jsps use different properties of the form with no problem.  Any
> > > suggestions ?
> > >
> > I think it is a problem with Javabean naming convention.
> > Try to replace property="JqRow" by property="jqRow".
> >
> > Jean-Noël
>
> --
> Marty Fisher
> Cranbury
> 609-409-0909
> HNC Software, Inc. (formerly Systems/Link Corporation)
>
> The information contained in this transmission is privileged and/or confidential
> information intended for the use of the individual(s) or entity named above. If
> the reader of this message is not the intended recipient, you are hereby notified
> that any dissemination, distribution, or copying of this communication is strictly
> prohibited.

--
Marty Fisher
Cranbury
609-409-0909
HNC Software, Inc. (formerly Systems/Link Corporation)

The information contained in this transmission is privileged and/or confidential
information intended for the use of the individual(s) or entity named above. If
the reader of this message is not the intended recipient, you are hereby notified
that any dissemination, distribution, or copying of this communication is strictly
prohibited.



Re: Missing Property

Posted by Marty Fisher <mf...@systemslink.com>.
Thanks, that did the trick - sort of.  There is the correct amount of data being
displayed and then an usuall error.

     1 U COMMAND1 2000-01-01 00:00:00.0 2000-01-01 00:00:00.0 P mfisher 2000-01-01
00:00:00.0 N 0 0 0 LOG 2

     500 Internal Server Error

     /struts/jobQueue.do:

     javax.servlet.ServletException: Exception thrown processing JSP page.
     javax.servlet.jsp.JspException: No bean found for attribute key list

If no bean can be found, where did the '1 U COMMAND1 ...' come from ?.  That line is
the correct contents of the String [] jqRow property.  It looks like the iterate
choked when it ran out of data.  Is that possible ?

Thanks again,
Marty Fisher

Jean-Noel Ribette wrote:

> > The jsp code:
> >
> >           <jsp:useBean id="jobQueueForm" type="JobQueueForm" />
> >
> >           <logic:iterate id="list" name="jobQueueForm" property="JqRow">
> >                  <bean:write name="list" />
> >           </logic:iterate>
> >
> > The form code:
> >
> >           public String [] getJqRow ()
> >          {
> >                    .
> >                    .
> >                    .
> >          }
> >
> > The error:
> >
> >          javax.servlet.jsp.JspException: No getter method for bean jobQueueForm
> > and property JqRow
> >
> >
> > Other jsps use different properties of the form with no problem.  Any
> > suggestions ?
> >
> I think it is a problem with Javabean naming convention.
> Try to replace property="JqRow" by property="jqRow".
>
> Jean-Noël

--
Marty Fisher
Cranbury
609-409-0909
HNC Software, Inc. (formerly Systems/Link Corporation)

The information contained in this transmission is privileged and/or confidential
information intended for the use of the individual(s) or entity named above. If
the reader of this message is not the intended recipient, you are hereby notified
that any dissemination, distribution, or copying of this communication is strictly
prohibited.



Re: Missing Property

Posted by Maya Muchnik <mm...@pumatech.com>.
Good eye!

Jean-Noel Ribette wrote:

> > The jsp code:
> >
> >           <jsp:useBean id="jobQueueForm" type="JobQueueForm" />
> >
> >           <logic:iterate id="list" name="jobQueueForm" property="JqRow">
> >                  <bean:write name="list" />
> >           </logic:iterate>
> >
> > The form code:
> >
> >           public String [] getJqRow ()
> >          {
> >                    .
> >                    .
> >                    .
> >          }
> >
> > The error:
> >
> >          javax.servlet.jsp.JspException: No getter method for bean jobQueueForm
> > and property JqRow
> >
> >
> > Other jsps use different properties of the form with no problem.  Any
> > suggestions ?
> >
> I think it is a problem with Javabean naming convention.
> Try to replace property="JqRow" by property="jqRow".
>
> Jean-Noël


Populate ActionForm

Posted by Frank Ling <st...@hotmail.com>.
Hi, There:

Here is the some question I have for the from populating, This maybe a
stupid question.

In the my simple search functionality Project.

I have the form-action combination as following.

PaymentSearchAction    PaymentSearchForm

DisplayStmAction          DisplayStmForm

in the PaymentSearchForm I take in all the search conditions, like
consultant name, stating date, ending date etc, then PaymentSearchAction
will perform the search and get all the result set in the session, then I
need populate all the result to DisplayStmForm, based on the setting in
struts-config.xml,  DisplayStmAction is the guy can access DisplayStmForm,
then the question is How DisplayStmAction can take control from this point
automaticlly, then I can populate the DisplayStmForm.

By another word, how can I jump from paymentSearchAction to DisplayStmAction
automatically, then I can use PaymentSearchAction populate PaymentSearchForm
to do the search then automatically switch to DisplayStmAction to populate
DisplayStmForm for the display.

Thanks

Frank Ling

Re: Missing Property

Posted by Maya Muchnik <mm...@pumatech.com>.
I think we have email archive for JavaBean convention. Here is a short answer:

when a property getter method has two or more upper case letters, then the property is
interpreted without change getter method. So if you have getAAA(), the property is
AAA. If you have getAaA(), then the property is aaA.


Ken Beyer wrote:

> On the same thread... can someone tell me why I can't put ....
>     property="aBCDefg" with a bean getter of "getABCDefg()"
>
> Note the 2nd char being an uppercase "B".  I were to make the "B" a
> lowercase "b",  it works.  The problem stems from the 2nd char in the
> property name being a capital.  I'm on Tomcat 3.3m1 + Struts 1.0b1
>
> Any advice?   is this a bug?
> Thx-
> Ken
>
> Jean-Noel Ribette wrote:
>
> > > The jsp code:
> > >
> > >           <jsp:useBean id="jobQueueForm" type="JobQueueForm" />
> > >
> > >           <logic:iterate id="list" name="jobQueueForm" property="JqRow">
> > >                  <bean:write name="list" />
> > >           </logic:iterate>
> > >
> > > The form code:
> > >
> > >           public String [] getJqRow ()
> > >          {
> > >                    .
> > >                    .
> > >                    .
> > >          }
> > >
> > > The error:
> > >
> > >          javax.servlet.jsp.JspException: No getter method for bean jobQueueForm
> > > and property JqRow
> > >
> > >
> > > Other jsps use different properties of the form with no problem.  Any
> > > suggestions ?
> > >
> > I think it is a problem with Javabean naming convention.
> > Try to replace property="JqRow" by property="jqRow".
> >
> > Jean-Noël
>
> --
> Ken Beyer
> Metatec Internet Products Group
> kab@metatec.com  |  http://www.metatec.com/
> "The box said 'Requires Windows 95 or better.' - so I installed Linux."


Re: remembering selected option question

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 16 Mar 2001, John Wright wrote:

> Maybe a newbie question here:
> 
> If a request is sent to a JSP page that has a <html:select>  tag but the
> request does not include a parameter with the same name as the property
> attribute of the <html:select> tag it is my understanding that an exception
> will be thrown saying that the request must contain the parameter.  If this
> is the case how do you handle cases in which you want to remember the
> selected option when there might be other screens accessed in between the
> times when the screen with the <html:select> tag is accessed?
> 

I'm not quite sure I understand your question completely, but the general
philosophy in Struts works like this:

* Requests are submitted to an Action (via the Controller servlet)
  rather than being submitted directly to a page.

* The controller servlet can associate a form bean (an instance of
  ActionForm) with the request, in order to capture the input fields
  from that request.  You would have a property to capture the current
  state of the property you are using <html:select> on, for example.

* If you need to keep the information about what was selected for more
  than one request, the typical approach would be to store the
  corresponding form bean in the user's session.


> Thanks,
> 
> John
> 

Craig McClanahan


remembering selected option question

Posted by John Wright <jw...@fyidocs.com>.
Maybe a newbie question here:

If a request is sent to a JSP page that has a <html:select>  tag but the
request does not include a parameter with the same name as the property
attribute of the <html:select> tag it is my understanding that an exception
will be thrown saying that the request must contain the parameter.  If this
is the case how do you handle cases in which you want to remember the
selected option when there might be other screens accessed in between the
times when the screen with the <html:select> tag is accessed?

Thanks,

John




Re: Missing Property

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 16 Mar 2001, Ken Beyer wrote:

> 
> On the same thread... can someone tell me why I can't put ....
>     property="aBCDefg" with a bean getter of "getABCDefg()"
> 
> Note the 2nd char being an uppercase "B".  I were to make the "B" a
> lowercase "b",  it works.  The problem stems from the 2nd char in the
> property name being a capital.  I'm on Tomcat 3.3m1 + Struts 1.0b1
> 

There are some somewhat arcane rules in the JavaBeans spec about what
happens when you've got property names with embedded capital letters -- I
would suggest going there (it can be found through
<http://java.sun.com/products>).

Struts is relying on the JDK's standard introspection classes, so it's
totally at the mercy of the JDK rules to define what valid property names
are.

> Any advice?   is this a bug?
> Thx-
> Ken
> 

Craig



Re: Missing Property

Posted by Ken Beyer <ka...@metatec.com>.
On the same thread... can someone tell me why I can't put ....
    property="aBCDefg" with a bean getter of "getABCDefg()"

Note the 2nd char being an uppercase "B".  I were to make the "B" a
lowercase "b",  it works.  The problem stems from the 2nd char in the
property name being a capital.  I'm on Tomcat 3.3m1 + Struts 1.0b1

Any advice?   is this a bug?
Thx-
Ken

Jean-Noel Ribette wrote:

> > The jsp code:
> >
> >           <jsp:useBean id="jobQueueForm" type="JobQueueForm" />
> >
> >           <logic:iterate id="list" name="jobQueueForm" property="JqRow">
> >                  <bean:write name="list" />
> >           </logic:iterate>
> >
> > The form code:
> >
> >           public String [] getJqRow ()
> >          {
> >                    .
> >                    .
> >                    .
> >          }
> >
> > The error:
> >
> >          javax.servlet.jsp.JspException: No getter method for bean jobQueueForm
> > and property JqRow
> >
> >
> > Other jsps use different properties of the form with no problem.  Any
> > suggestions ?
> >
> I think it is a problem with Javabean naming convention.
> Try to replace property="JqRow" by property="jqRow".
>
> Jean-Noël

--
Ken Beyer
Metatec Internet Products Group
kab@metatec.com  |  http://www.metatec.com/
"The box said 'Requires Windows 95 or better.' - so I installed Linux."




Re: Missing Property

Posted by Jean-Noel Ribette <je...@improve.fr>.
> The jsp code:
>
>           <jsp:useBean id="jobQueueForm" type="JobQueueForm" />
>
>           <logic:iterate id="list" name="jobQueueForm" property="JqRow">
>                  <bean:write name="list" />
>           </logic:iterate>
>
> The form code:
>
>           public String [] getJqRow ()
>          {
>                    .
>                    .
>                    .
>          }
>
> The error:
>
>          javax.servlet.jsp.JspException: No getter method for bean jobQueueForm
> and property JqRow
>
>
> Other jsps use different properties of the form with no problem.  Any
> suggestions ?
>
I think it is a problem with Javabean naming convention.
Try to replace property="JqRow" by property="jqRow".

Jean-Noël