Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet how to Use jsp:setProperty to set one bean in other bean while to be set bean is of type java.util.List
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Ashish
how to Use jsp:setProperty to set one bean in other bean while to be set bean is of type java.util.List
0 Answer(s)      3 years and 2 months ago
Posted in : JSP-Servlet


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.


Advertisement
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
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
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
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
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
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 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
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 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
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
Java Bean
Java Bean  What is Java Bean?   I got my answer already here: http://www.roseindia.net/jsp/usingbeansinjsp.shtml Thanks a lot
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
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
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
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 <...; 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
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
bean area - SQL
bean area  how to print bean area in excel sheet from oracle forms
how insert multiple images in mysql database with use of struts 1.3.8 or java method, with single bean,or using array
how insert multiple images in mysql database with use of struts 1.3.8 or java method, with single bean,or using array  i am using netbeans 7.0 ,with struts 1.3.8 and i want to insert multiple images in mysql database ,with use
JSF Manage Bean
JSF Manage Bean   how to register JSF manage bean? Please give me an example. Thanks!   JSF Manage Bean Example
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
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
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
 

 

 

DMCA.com