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

Ads









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
JSP bean set property   ... you a code that help in describing an example from JSP bean set property...:useBean> -  The  < jsp:use Bean> instantiate a bean class
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.... The above figure shows how Session Bean interacts... the functionality of the session bean. Session beans can call to other session
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
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
Java Bean
Java Bean  How to run java bean program in Netbeans
Managed Bean
Managed Bean  What is Managed Bean
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. package spel.wiringvaluesfromotherbeanproperties
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
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
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...; <HEAD><TITLE>Use Bean Counter Example</TITLE> <
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
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 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
Chapter 13. Enterprise Bean Environment
to the enterprise bean instances at runtime. The enterprise bean's instances use.... Each enterprise bean defines its OWN set... are not shared with other enterprise beans. Enterprise bean instances
A Message-Driven Bean Example
event log. Portable  Use one of the System.out.println methods... A Message-Driven Bean Example   ... messages asynchronously,  a Message-driven bean is used. Message driven
Version of bean-displaytag>bean-displaytag dependency
List of Version of bean-displaytag>bean-displaytag dependency
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
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
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.
ejbPassivate. While the container is not required to use the Serialization... Identify the use and the behavior of the ejbPassivate method in a session bean, including the responsibilities of both the container
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. spring boot How to solve this? Thanks   Hi, You should annotate
Bean
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
An Entity Bean Example
the database. We use EJB3 session bean POJOs to implement the business logic... the container for an instance of the session bean to use, either through dependency... when it makes a bean method call.   In order to use
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

Ads