File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Pass JSP input variables to an EJB. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Pass JSP input variables to an EJB." Watch "Pass JSP input variables to an EJB." New topic

Pass JSP input variables to an EJB.

steve dowdall
Ranch Hand

Joined: May 23, 2001
Posts: 36
Can someone explain to me a little on how I would go about capturing three variables, say , name,userid, and doctype from a JSP page and pass them to an EJB for processing. Kinda new to the JSP thingie...
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Here's a tutorial from Sun that uses a JavaBean as a facade (or is it proxy?) to an EJB. The JSP then uses the useBean methods.

You were talking about the other way around, from JSP -> EJB, but perhaps this will give you a starting point?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Or you could cheat.
I haven't formally announced it yet (or maybe that just did), but I've posted a new production release - 3.4.0. The EJBWizard is a template-based RAD generator for Enterprise JavaBeans. In addition to generating the core code for EJBs, it also creates prototype JSPs that access them.
There are 2 JSPs generated by the supplied templates - a detail view/edit bean which works in conjunction with a support class that probably will be rewritten to be JavaBean (it really already is, except for the packaging) and a collection view, which accesses the EJBs more directly.
The 3.4.0 release supports WebLogic 6.1 and (I HOPE!) now provides the templates for JBoss that were missing from earlier releases. It's available from the site.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Pass JSP input variables to an EJB.
It's not a secret anymore!