how to Use jsp:setProperty to set one bean in other bean while to be set bean is of type java.util.List
I have 3 Java POJOs as follows
Class Book.java
public class Book {
private String isbn;
private String bookName;
private Publisher publisher;
private String publishDate;
private int price;
private List<Chapter> chapters;
// Getters and Setters
Class Publisher.java
public class Publisher {
private String code;
private String name;
private String address;
// Getters and Setters
and Chapter.java
public class Chapter {
private int index;
private String title;
private int numOfPages;
// Getters and Setters
I have a single jsp (a.jsp) containing input fields for all the 3 classes, and action of that jsp goes to another jsp(say b.jsp).
In b.jsp I am using Standard tag as follows
<jsp:useBean id="publisher" class="chapter.one.Publisher" scope="session"/>
<jsp:setProperty name="publisher" property="*"/>
<jsp:useBean id="chapter" class="chapter.one.Chapter" scope="session"/>
<jsp:setProperty name="chapter" property="*"/>
<jsp:useBean id="book" class="chapter.one.Book" scope="session"/>
<jsp:setProperty name="book" property="*"/>
<jsp:setProperty name="book" property="publisher" value="${publisher}"/>
Its fine till here, But I am not getting how do I set the value of chapters properties(in Book.java), as its type is List not Chapter.
<jsp:setProperty name="book" property="chapters" value="${}"/>
Hope somebody can help.
Thanks.
Ashish.
View Answers
Related Tutorials/Questions & Answers:
JSP bean set property;This is used to
set the value of
one or more
properties of
bean using setter method...
JSP
bean set property
... you a code that help in describing an
example from JSP
bean set property
Advertisements
BeanBean what is
bean?
how to
use bean
HTML Code:
Contents
MOBILE STORE
HOME
PRODUCTS
IMAGES
COMPANY... viji");
rs=st.executeQuery();
while(rs.next
Session Bean not be saved to the database) its value. A session
bean can have only
one
client..._TO_REPLACE_1
The above figure shows
how Session
Bean interacts... if the user wants to
use the functionality of the session
bean. Session
beans can call
Use Java Bean In ServletsUse Java
Bean In Servlets
In this you will learn
how to
use Java
Bean in Servlets. For this purpose, we have created a
Bean named 'Person' and defined three... of this
Bean in servlet and using the
set method of
bean, we have passed some values
SPEL-Wiring values from other bean properties take an
example to demonstrate
how SpEL is used to wire value from
other bean...SpEL: Wiring value from
other bean properties
Spring 3 provides powerful... which is of
Set type.
(adsbygoogle = window.adsbygoogle || []).push
Java BeanJava Bean
How to run java
bean program in Netbeans
Java BeanJava Bean What is a Java
Bean?
A Java
Bean is a software component that has been designed to be reusable in a variety of different environments
entity beanentity bean can any
one tell me
how to develop and execute ---------- j2ee entity beans (cmp,bmp) example in weblogic server with (netbeans.../ejb/entity-
bean-example.shtml
Using Bean Counter in JSP;
In this section you will learn
how the counter
bean can be used in jsp. As you all know a counter increments the value by
one. Here, we will
use...="form.CounterBean" />
<HTML>
<HEAD><TITLE>
Use Bean Counter
Java BeanJava Bean What is Java
Bean?
I got my answer already here: http://www.roseindia.net/jsp/usingbeansinjsp.shtml
Thanks a lot
Chapter 13. Enterprise Bean Environment bean's deployment
descriptor. The Deployer can
SET and MODIFY... OWN
set of environment entries. All
instances of an enterprise
bean... entries are not shared with
other enterprise beans.
Enterprise
bean bean objectbean object i have to retrieve data from the database and want to store in a variable using rs.getString and that variable i have to
use in dropdown... java.util.*;
public class
Bean {
public List dataList(){
ArrayList list=new
A Message-Driven Bean Example. These methods write to the JRun server's event log.
Portable
Use one... A Message-Driven
Bean Example
... messages
asynchronously, a Message-driven
bean is used. Message driven
bean area - SQLbean area
how to print
bean area in excel sheet from oracle forms
Spring bean annotation exampleSpring
bean annotation example Hi,
How to configure
Bean using annotation in Spring Framework?
Thank
Hi,
I will explain you
how...(){
System.out.println("Hello");
}
}
Now to configure it as
Bean you can
use the @
Bean JSF Manage Bean JSF Manage
Bean how to register JSF manage
bean? Please give me an example.
Thanks!
JSF Manage
Bean Example
How to get the output of JSP program using Bean;HTML>
<HEAD><TITLE>
Use Bean Counter Example</TITLE>
<... program for the above
one by using
Bean and i opened the Tomcat webserver...
How to get the output of JSP program using Bean Hi
Kindly go
An Entity Bean Example the database. We
use EJB3 session
bean
POJOs to implement the business logic.... It
simply
asks the container for an instance of the session
bean to
use, either...;
In
order to
use the entity beans in the session
bean, you need a special utility
How to get the output of jsp program using Bean" %>
<HTML>
<HEAD>
<TITLE>
Use Bean Counter Example <...;
Next i created JSP program for the above
one by using
Bean and i opened...
How to get the output of jsp program using Bean Hello my Roseindia
message driven bean examplemessage driven
bean example can any
one tell me
how to develop and execute ---------- j2ee message driven
bean example in weblogic server with (netbeans or eclipse).
Have a look at the following link:
http
Bean life cycle in spring;
This example gives you an idea on
how to Initialize
bean in the program... by
bean class. The
use of
this interface here is to do some post processing actions when all the properties have been
set
by the
Bean Factory
Cmp Bean - EJBCmp
Bean I want to create connection pool in admin console in sun app server
the data base is sql server, I gave the resource
type..., password , database name correctly atlast,
while i give the ping button
bean - JSP-Interview Questionsbean what is
use bean in jsp? Hi Friend,
Please visit the following links:
http://www.roseindia.net/jsp/using-
bean-counter.shtml
http://www.roseindia.net/jsp/java-
bean-example-jsp.shtml
Hope
Result Set one to many mappingResult
Set one to many mapping Suppose there are 5 tables in database named A,B,C,D and E.
A has
one to many relationship with B,C,D and D has
one...
Bean class of D contains array of Class E
Suppose my query is Select * from
Bean life cycle in spring;
This example gives you an idea on
how to Initialize
bean in the program... by
bean class. The
use of
this interface here is to do some post processing actions when all the properties have been
set
by the
Bean Factory
How to Run First Java Bean Program ?How to Run First Java
Bean Program ? Hi My Dear Friend
I can run...
But Now I need that
How to run Java
Bean
Now I have BDK1.1 But still don't...
in this dir. just a run.bat file which execute Java
Bean with GUI mode but
I wants
how Example of struts2.2.1 bean tag.Example of struts2.2.1
bean tag.
In this tutorial, you will see the
use of
bean tag of struts2.2.1 tag. The
Bean tag is a generic tag that is used... which can contain a number of
Parma elements to
set any mutator methods
Session Bean ExampleSession
Bean Example I want to know that
how to run ejb module by jboss 4.2.1 GA (session
bean example by jboss configuration )?
Please visit the following link:
http://www.roseindia.net/javabeans
Java Bean - Java BeginnersJava Bean Sir,
How can i add a java
bean into a target GUI....
Thanking you
Pabitra Kr Debanth.
Hi friend,
Java
Bean classes must be made serialization so that they support persistent storage. To make
use