Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #4555

Is JavaBeans able to store an array?

X-FeedAbuse http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.16.109
Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!nospam.fr.eu.org!usenet-fr.net!nerim.net!novso.com!newsfeed.kpn.net!pfeed09.wxs.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!postnews.google.com!35g2000prp.googlegroups.com!not-for-mail
From byhesed <byhesed@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Is JavaBeans able to store an array?
Date Tue, 24 May 2011 18:15:35 -0700 (PDT)
Organization http://groups.google.com
Lines 50
Message-ID <5ec5c70e-03e1-46ae-8ed4-b79ddfef70a0@35g2000prp.googlegroups.com> (permalink)
NNTP-Posting-Host 119.202.36.92
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1306286144 20939 127.0.0.1 (25 May 2011 01:15:44 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Wed, 25 May 2011 01:15:44 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info 35g2000prp.googlegroups.com; posting-host=119.202.36.92; posting-account=v_GC8QoAAABz34PprEBWdejdnnHZvg4_
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-Header-Order HNKRUAELSC
X-HTTP-UserAgent Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4555

Show key headers only | View raw


Can I handle array values using JavaBeans?
I could'n find the way to pass an array to JavaBeans.

Below is my situation.

There are four checkboxes.
I want to handle those values in JavaBeans.

----------------------------------------------------------------------------------------------------
1. TestBeanForm.jsp
----------------------------------------------------------------------------------------------------
<form action="TestBean.jsp" method="post">
    <input type="checkbox" name="books"> Java for Student<br>
    <input type="checkbox" name="books"> Compiler Construction<br>
    <input type="checkbox" name="books"> Software Engineering<br>
    <input type="checkbox" name="books"> Core Servlet and JSP<br>
    <p>
    <input type="submit" value="Submit">
</form>
----------------------------------------------------------------------------------------------------

Here, I use JavaBeans.
----------------------------------------------------------------------------------------------------
2. TestBean.jsp
----------------------------------------------------------------------------------------------------
<%@page import="test.TestBean"%>

<jsp:useBean id="testBean" class="test.TestBean">
	<jsp:setProperty name="testBean" property="*"/>
</jsp:useBean>
<jsp:getProperty name="testBean" property="books"/>
----------------------------------------------------------------------------------------------------

When dealing with thoes values using JavaBeans,
Only the first books element is passed to JavaBeans.
Here is my javaBean.

----------------------------------------------------------------------------------------------------
3. TestBean.java
----------------------------------------------------------------------------------------------------
package test;

public class TestBean {
	private String books;

	public void setBooks(String books) { this.books = books; }
	public String getBooks() { return books; }
}
----------------------------------------------------------------------------------------------------

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar


Thread

Is JavaBeans able to store an array? byhesed <byhesed@gmail.com> - 2011-05-24 18:15 -0700
  Re: Is JavaBeans able to store an array? Lew <noone@lewscanon.com> - 2011-05-25 09:15 -0400
    Re: Is JavaBeans able to store an array? byhesed <byhesed@gmail.com> - 2011-05-26 22:11 -0700
      Re: Is JavaBeans able to store an array? Lew <noone@lewscanon.com> - 2011-05-27 01:38 -0400
        Re: Is JavaBeans able to store an array? byhesed <byhesed@gmail.com> - 2011-05-27 03:54 -0700
          Re: Is JavaBeans able to store an array? Lew <noone@lewscanon.com> - 2011-05-27 10:25 -0400
            Re: Is JavaBeans able to store an array? byhesed <byhesed@gmail.com> - 2011-05-29 17:26 -0700

csiph-web