• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Call an EJB from JSP

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
How do I call an EJB from a JSP? I have an ejb deployed on Weblogic and which runs fine from a stand alone java client. I would like to run it from the web using jsp. Not sure what the code needs to look like. I want it so that anyone with a browser can hit it.
sample code appreciated...
many thanks,
steve
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not have the sample code you asked for, however I think you should use some kind of JSP-Servlet-EJB model for your project. ie. using JSP for front end presentation, using servlet program as controller and using EJB as application logic, this fits the so called "MVC"-Model-View-Controller pattern.
The details as to how to invoke servlet from JSP and return back to JSP from servlet are quite simple and straightforward. You can find it in nay JSP book. You can invoke your EJB session bean from your servlet code and through the session facade to do all business logic stuff.
Hope this helps.
Tieyi
 
steve dowdall
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,
I'm using the MVC 5 layered architecture. I was just looking for some jsp code to call the ejb.
Steve
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I heard about MVC2 . what's MVC5 here? can you please explain.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,as per my knowlege there are just 2 model of MVC(1 and 2).
Whats MVC 5 man?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic