File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Call an EJB from JSP

 
steve dowdall
Ranch Hand
Posts: 36
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Tieyi Guo
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Liz Brown
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I heard about MVC2 . what's MVC5 here? can you please explain.
 
Ronak Patel
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,as per my knowlege there are just 2 model of MVC(1 and 2).
Whats MVC 5 man?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic