Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Creating a Class in EJB and using it in my Struts Forms.

Posted on 2004-08-18
8
Medium Priority
?
286 Views
Last Modified: 2013-11-24
Hi,

Please look here:

http://jaggybala.clawz.com/CalendarTool/ShowList.html

At present i have 3 JSP's, 2 Form-Bean and 2 Form-Action as follows:

     JSP                       Form-Bean               Form-Action
  ------------              -----------------         -------------------
  FilterList.jsp           FilterForm.java           FilterAction.java
 RegisterList.jsp       RegiterForm.java        RegisterAction.java
 ShowList.jsp                   ---                             ---

ShowList.jsp includes FilterList.jsp and RegisterList.jsp

At the bottom, you can see a list of members.

Q is : *I want to populate a colleciton of members with dummy objects and return it from inside the EJB.*

I was adviced by girinois as:
--------------------------------
Just create the EJB (obtain the home interface) and then call the remote method on the EJB. In one of the remote methods pass an array or a vector of the dummy objects you have. Then do the processing you want in the EJB.

I am a new-bie for EJB and Struts... Could anyone give me some code hints...

Thanks for reading.
0
Comment
Question by:sangeetha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 1200 total points
ID: 11838508
It depends on what you want to do inside your EJB. Do you want to create the list in there or create the list somewhere else, pass it in the EJB, do your processing and then return the result. Since you already have an action form you might as well create the list in the action form although you might as well create it in the EJB. A solution would be to pass the HttpSerlvetRequest object but this is tend to avoid this.

What I suggest is that you might want to take a look here: http://www.devx.com/Java/Article/21065 for integrating EJBs and struts, go through the sample code, understand what's going on and then come back to here and ask a question again? I think it is a good tutorial and will give you a basic understanding fo what's going on using ejbs and struts.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 11843284
>> I want to populate a colleciton of members with dummy objects and return it from inside the EJB

I would assume that you want to create the list of members inside the EJB. You just need to code it like any normal method which returns a Collection (if you wanna use Collections). Do you want help with writing code to obtain the home interface, etc?

Which server are you using?

Make sure that anything which is passed to the EJB or returned from it is serialized.
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11896773
thanks for your replies. sorry for being late.
The article was good, but i find it bit difficult to copw up with home interface, remote interface, etc...

Could you please explain me how and when to use home interface/remote interface. I am using JBoss server.

all the tutorials are too advanced for my java knowledge.

thanks again.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 800 total points
ID: 11899757
Hi Sangeeta,

Try a basic tutorial first - http://www.ejbtut.com

Rgds,
Mayank.
0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 1200 total points
ID: 11900020
I agree with mayankeagle, read a tutorial on EJBs first: http://developer.java.sun.com/developer/onlineTraining/EJBIntro/EJBIntro.html it will you give you an understanding of what's going on.
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 800 total points
ID: 11900175
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11901108
Ok...thanks.
0
 
LVL 35

Expert Comment

by:girionis
ID: 11901144
:)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
A solution for Fortify Path Manipulation.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question