• 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
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

accesing ejb's from jsp

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
recently we've tried to connect to ejb interface firectly from
jsp. but it is giving a proble. please somebody let me know whether we can directly connect from jsp by writing the look up code in scriptlets or is it compulsory that we've to use a middle layer like servlets or tag libraries etc..
thanks in advance.
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJBs can indeed be accessed directly from scriptlets within a JSP using the same code as you would normally use. One thing to make sure is that you import all of the appropriate classes using the page directive.
Of course, just because you *can* access EJBs directly from a JSP doesn't mean that you *should*. Placing logic like this mixes business and presentation logic, clutters up the page and ultimately makes it more difficult for web desigers to weave their creative magic. In this situation, a custom tag layer is a good solution and one that I would recommend.
Hope that helps...
Simon
------------------
Simon Brown
Co-author of Professional JSP 2nd Edition
 
Get out of my mind! Look! A tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic