on 04-17-2008 6:37 AM
Cuold anyone provide me information of
1. How to create Java bean class in NDS
2. Mapping Collection of objects/javabeans between View and Controller.
Example:
I have requirement of carring collection of employees between view ,controller and model layer as below..
ArrayList arl=new ArrayList();
arl.add(new Employee("john","1001"));
arl.add(new Employee("steeve","1002"));
-
public class Employee{
private String name=null;
private String no=null;
Employee(String name,String no){
this.name=name;
this.no=no;
}
public String getName(){
return this.name;
}
public String getNo(){
return this.no;
}
public setName(String name){
this.name=name;
}
public setNo(String no){
this.no=no;
}
}
Hi Raghu,
Go to package explorer view in web dynpro perspective. There you will find src/packages under your project. On context menu of src/packages, create a package for eg., com.sap.java.Using context menu of com.sap.java, create a class Employee. In this class paste your code and save the file.
Now go to web dynpro explorer. Now Create model. Choose Import Java bean model. Give some name to model and package. Click next. It will show list of all java classes that you have created. Select Employee. Click next, select attributes you want in Employee Node and then click finish. Your Employee java class will be now available as Model class.
Regards,
Gopal
Edited by: Gopal on Apr 17, 2008 12:20 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghu,
For javabeans
1. create a javabean project first. Where you can implement session beans and entity beans.
2. Create a simple java project(usually it is called as commanbean) to access the session bean.
3. create a javabean model using commandbean.
4 and map model ->controller -> view.
please go through folowing documents
using EJB`s in web dynpro
and try to implement quick car rental application. its the simplest one. after that definatly you will be able to use java beans
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.