how to Use jsp:setProperty to set one bean in other bean while to be set bean is of type java.util.List

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:
how to Use jsp:setProperty to set one bean in other bean while to be set bean is of type java.util.List<beantype>
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... here, But I am not getting how do I set the value of chapters properties
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
Bean
Bean  what is bean? how to use bean   HTML Code: Contents MOBILE STORE HOME PRODUCTS IMAGES COMPANY... viji"); rs=st.executeQuery(); while(rs.next
how to use bean to retrieve data from database
how to use bean to retrieve data from database  how to use bean to retrieve data from database   poda sendru
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
How to add a bean in spring application?
How to add a bean in spring application?  Hi, How to add a bean in spring application? Thanks
Use Java Bean In Servlets
Use 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 Bean
Java Bean  How to run java bean program in Netbeans
How to get Output for a Bean problem
How to get Output for a Bean problem  Hello Kindly tell me a simple Program on Bean to get the Output using JSP code
Managed Bean
Managed Bean  What is Managed Bean
Java Bean
Java 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 bean
entity 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
How to use Bean Area in Oracle Forms 9i with Sample code ?
How to use Bean Area in Oracle Forms 9i with Sample code ?  Hi friend.I posted a query,but I didn't get the answer for it.Help me to resolve including a bean area in oracle forms 9i and using it in forms.Thanks in advance.Help me
Java Bean
Java Bean  What is Java Bean?   I got my answer already here: http://www.roseindia.net/jsp/usingbeansinjsp.shtml Thanks a lot
Mean by Bean Scope
Mean by Bean Scope  What is Bean Scope
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
Version of bean-displaytag>bean-displaytag dependency
List of Version of bean-displaytag>bean-displaytag dependency
bean object
bean 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
consider defining a bean of type in your configuration. spring boot
consider defining a bean of type in your configuration. spring boot  ... following error at runtime: consider defining a bean of type in your configuration...({}); How to solve this? Thanks   Hi, (adsbygoogle
bean area - SQL
bean area  how to print bean area in excel sheet from oracle forms
Spring bean annotation example
Spring 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
What is bean wiring?
What is bean wiring?  Hi, What is bean wiring? Thanks
What is Bean Factory ?
What is Bean Factory ?  Hi, What is Bean Factory ? Thanks
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
Bean
Bean
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 example
message 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 - EJB
Cmp 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 Questions
bean  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 mapping
Result 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
Identify the use and the behavior of the ejbPassivate method in a session bean, including the responsibilities of both the container and the bean provider.
Identify the use and the behavior of the ejbPassivate method in a session bean, including the responsibilities of both the container and the bean provider. Prev Chapter 3. Session Bean
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
Special Bean Types of WebApplicationContext
In this section, you will learn about Special Bean Types in the WebApplicationContext
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 Example
Session 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
Maven Repository/Dependency: bean-displaytag | bean-displaytag
Maven Repository/Dependency of Group ID bean-displaytag and Artifact ID bean-displaytag. Latest version of bean-displaytag:bean-displaytag dependencies... read more at: Maven Tutorials What is Apache Maven? How
Writing Session bean - Session Bean Example with Source Code
Writing Session bean In this lesson you will learn how to develop Hello World Session Bean. We will use ant to build the application. Our application... the application Define Home Interface The Session bean's home interface defines one
Java Bean - Java Beginners
Java 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
calling a session bean bean from servlet using netbeans - EJB
calling a session bean from servlet using netbeans  How to call a session bean from servlet using netbeans in Java
Maven dependency for org.touchbit.retrofit.veslo - bean version 1.2.0 is released. Learn to use bean version 1.2.0 in Maven based Java projects
Developer can use this version ( org.touchbit.retrofit.veslo - bean version... of org.touchbit.retrofit.veslo - bean in your Maven/Gradle project. Step 1: Create or use a Maven project...; org.touchbit.retrofit.veslo - bean version 1.2.0 Now the next step is to use
Maven dependency for org.touchbit.retrofit.veslo - bean version 1.0.1 is released. Learn to use bean version 1.0.1 in Maven based Java projects
Developer can use this version ( org.touchbit.retrofit.veslo - bean version... of org.touchbit.retrofit.veslo - bean in your Maven/Gradle project. Step 1: Create or use a Maven project...; org.touchbit.retrofit.veslo - bean version 1.0.1 Now the next step is to use
Maven dependency for org.touchbit.retrofit.veslo - bean version 1.0.0 is released. Learn to use bean version 1.0.0 in Maven based Java projects
Developer can use this version ( org.touchbit.retrofit.veslo - bean version... of org.touchbit.retrofit.veslo - bean in your Maven/Gradle project. Step 1: Create or use a Maven project...; org.touchbit.retrofit.veslo - bean version 1.0.0 Now the next step is to use

Ads