Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

EJB development with a web client

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!