On Thu, 17 Jun 1999, Bill O'Keefe wrote:
> Chris,
>
> >> I have a question on using beans from JSP. According to
> >> my understanding, the <usebean:> tag can be used to
> >> access a normal bean, but one has to use the JNDI API
> >> to lookup a proxy to access an Enterprise JavaBean (ejb).
> >> Thus, one has to write a block of Java code in the JSP to
> >> get access to an ejb. Is this true, or does the <usebean:>
> >> tag also support ejbs, and if so, how? Thanks.
> >> -- Bill
> >
> >JSP 1.1 is supposed to have more EJB support. However, the details are
> >sketchy.
> >
> >To make sure we're starting with a clear understanding: EJB's have
> nothing to
> >do with regular JavaBeans (except that both happen to have the word 'bean' in
> >their names, which was probably a bad marketing choice). If you want your
> JSP
> >page to be an EJB client, then yes, you will have to follow the EJB client
> API
> >from within your jsp page. Which means that you will have to use JNDI to
> >locate your EJB. This has absolutely nothing to do with the way JavaBeans
> and
> >JSP works.
>
> Thanks for the response. This was pretty much the same conclusion
> I came to, but I just wanted to make sure I wasn't missing something.
> It took me a few days of spec reading to determine that the only
> real similiarity between JavaBeans and Enterprise JavaBeans is
> that they are both components, with completely different characteristics
> (one for client side app development and the other for server-side
> development).
>
>
> >Since JSP and EJB's are both part of the J2EE (Java 2 Enterprise Edition),
> >they may provide more integration in JSP 1.1. But even if they make some
> >things invisible, I would guess that under the covers, JNDI and the rest of
> >the EJC client API would have to be followed.
>
> This is basically what I was asking, i.e., are there any EJB-specific
> options available with the <usebean:> tag to make things simpler for
> JSP developers who want to access EJBs. I realize it's not rocket science
> to locate an EJB via JNDI, but it seems to me that this causes the JSP to get
> 'cluttered' with some repeated boiler-plate code that could be hidden via
> a <usebean> (or maybe <useEJB>???) tag. Sounds like this is still TBD
> from what you're saying.
>
> -- Bill
>
> --
> Bill O'Keefe [EMAIL PROTECTED]
> Open Market, Inc. http://www.openmarket.com/
> One Wayside Road TEL: 781.359.7296
> Burlington, MA 01803 FAX: 781.359.8200
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JSP-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
Actually, couldn't you just have a servlet that looked up the EJB through
the JNDI and then called the JSP file, passing the found EJB to the JSP
file through an attribute in the Request object?
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".