on 09-07-2006 1:03 PM
Hi All,
I am fairly new to java. I am trying to go ahead with a java bean model.
For that I need a jar file. Can any one help me how to create a jar file.
Looking forward to you.
Regards
DK
Hi
Rightclick the Project(or from File menu) and select Export you can see the Jar format there.Select the jar and give the name.
Kind Regards
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mukesh,
Thanks for your reply.
I Created a simple Java Bean (JavaClass) and created jar file from that project.
From Web Dynpro, i created a Java Bean Model using this jar file. When i try to make a connection between controller and Model using Apply Template, i am getting "Context Element Can't bound to model layer." Error. So i created a data link and from View to Controller also.
When i try to run this application, it is giving
java.lang.NoClassDefFoundError: com.test.TestClass
at com.accenture.practice.rrs.wdp.InternalJavaModelComp.<init>(InternalJavaModelComp.java:45)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Regards,
Sridhar
Hi DK,
For Java Bean Model I have Created a Bean with two fields. Follow the below procedure.
Step - 1 First create a simple java bean in NWDS in Java Perspective.
Public class TestJavaClass implements java.io.Serializable{
int code = 10;
String name = "SAP";
// generate Getter and Setter Methods for these fields.
}
Export this project as jar for the Java Bean Model.
Step - 2 From Web Dynpro Perspective
Importing java bean model implementation:
1) In the proj structure expand Webdynpro>Models>create model.
2) Choose the import java bean model option followed by Next.
3) Select Local Jar File Radio Button -> Add Jar -> Next -> Finish.
4) Add the Jar file to your Web Dynpro Project from Navigator View -> Lib -> Paste the jar file. -> Re Build the Project.
Step - 3 Accessing Bean Model in Web Dynpro
In the data modeller toolbar, create a data link b/w component controller and bean model. Draw a line starting from controller to the model.
Using drag and drop and drag the node of model Bean in the bean model to the root node of comp.ctrller.
Select the model node and all the model att.
Now if u expands the context tree in the following the link b/w component controller and the model is displayed graphically through the link lines.
Access Bean Property like this.
wdContext.currentTestJavaClassElement().modelObject().getCode();
(OR)
new TestJavaClass().getCode();
For more information go through this link.
/people/david.beisert/blog/2004/10/26/webdynpro-importing-java-classes-as-model
EJBs Use in NWDS
-> Add also the ejb20.jar to the class path.
Regards,
SK
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.