This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Websphere and the fly likes EJB development with a web client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "EJB development with a web client" Watch "EJB development with a web client" New topic
Author

EJB development with a web client

Kara C
Greenhorn

Joined: Jun 25, 2002
Posts: 1
Hi,
I have just started to use WebSphere Application Developer in the last week and I have ran into difficulities in developing EJB's with a web-based client like JSP or a servlet. I have experience in developing EJB's with SUN's default package(deploytool) but the process is very different with WebSphere. I have worked through some tutorials but I can't get past a certain point!
Here is what I have been doing:
1. I created a new Enterprise Application Project.
2. I created my EJB's in the Appropiate folder, added the appropiate methods and compiled the programs, etc.
3. I then generated the deploy and RMIC code for the Bean
4. I ran the test client to test the bean and I could create a new instance of the bean and play with the methods successfully, etc.
5. I created my web client, in this case a JSP, in the appropiate web folder.
I encounter a problem at this point. I can't compile the JSP because the EJB imports in the JSP are not recognised, the JSP cannot find the beans. If I move the JSP into the same folder as the beans I cannot run them on the server?
I have to be missing a step but I don't know what it is. If anyone has any ideas or a recommended tutorial which addresses these issues I would greatly appreciate it.
Thanks
Jay Damon
Ranch Hand

Joined: Jul 31, 2001
Posts: 279
Your description suggests that you are attempting to access your EJBs directly from your JSPs. If you are having visibility problems, you may need to Edit Module Dependencies and/or update the Java Build Path for your Web Application module.
However, I would suggest that you reconsider your design. Personally, I would NEVER attempt to access EJBs directly from a JSP. At a minimum, I would create an access or wrapper bean around the EJB and access the EJB through it. Your approach results in a lot of unnecessary code in the presentation layer, i.e. the JSP.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB development with a web client
 
Similar Threads
J2EE Recommended Reading
where to write the client code in websphere?
difference b/w EJB ,servlets
ClassCastException: Cannot narrow...
long post IBM.158