tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart N. Locanthi" <b...@sabl.com>
Subject Re: BUG: setProperty and arrays
Date Sat, 22 Jul 2000 17:54:46 GMT
hey, don't ask me, i was surprised it dealt with arrays at all.

again, i haven't sniffed the protocol to see exactly where the bug lies.

if you're a browser, and one of your fields is null, you aren't obliged
to send that info. nor are you obliged to send fields back in the order
they are displayed.

i read the jsp spec on arrays to mean that you'll get a list of strings
back from a form with same-named fields. no guarantees beyond that.

my preference is to use a syntax like <... name="a.4" ...> and handle
that with a <setProperty>-like tag that does exactly what you want in
all cases.

tags are really easy to define once you get the hang of it.

> I agree, this will be a great feature, however, if Tomcat does not call the
> setGrade() method when the zero element is null, then I can't use it.  Is
> there a work around?  This sounds like a bug to me.  When can this one be
> fixed?
> 
> >===== Original Message From "Bart N. Locanthi" <bart@sabl.com> =====
> >this *almost* works. i'm pleasantly surprised that it tries.
> >
> >however, if the first text input is blank, the setGrade() doesn't get
> >called.
> >
> >i presume this is a bug. possibly in my netscape 4.73 or my mid-june
> >build of tomcat.
> >
> >> Date: Thu, 20 Jul 2000 13:19:05 -0700 (PDT)
> >> To: tomcat-user@jakarta.apache.org
> >> From: "David M. Holmes" <david_m_holmes@yahoo.com>
> >> Subject: RE: setProperty and arrays
> >> Message-ID: <20000720201905.9657.qmail@web1004.mail.yahoo.com>
> >>
> >> 1 is correct, the browser will basically submit an array of values for the
> >> same-named elements. I
> >> just verified this.
> >>
> >> # HTML
> >> <form action="test.jsp" method="post">
> >> <input type="text" name="grade" value="" size="10"><Br>
> >> <input type="text" name="grade" value="" size="10"><Br>
> >> <input type="text" name="grade" value="" size="10"><Br>
> >> <input type="text" name="grade" value="" size="10"><Br>
> >> <input type="submit" name="submit" value="Submit">
> >> </form>
> >>
> >> # JSP
> >> <jsp:useBean id="grades" class="test.Grades" scope="request">
> >>         <jsp:setProperty name="grades" property="*"/>
> >> </jsp:useBean>
> >>
> 
> ------------------------------------------------------------
> Bob Byron
> RAD Systems, Inc.
> (972)516-4256

Mime
View raw message