This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello Simon Cockayne, EJBs can only be invoked from a Java Application, be it a Servlet, JSP or simple StandAlone program. HTML is simple text file and can not invoke EJB.
Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Joined: Dec 11, 2000
Additionally, I was under the impression that EJB's can also be invoked by non java applications. E.g. C++ and .NET I thought.
So, to recap. Given a HTML web page, how can I extend or enhance it, potentially through some embedded "non-html", such that an EJB can be invoked.
I am most grateful for your kind attention.
Joined: Sep 28, 2002
Here is an extract from Mastering EJB from Ed Roman
Understanding How to Call Beans We now take a look at the other half of the world�the client side. We are now customers of the beans� business logic, and we are trying to solve some realworld problem by using one or more beans together. There are two different kinds of clients.
Java RMI-IIOP based clients. These clients use the Java Naming and Directory Interface (JNDI) to look up objects over a network, and they use the Java Transaction API (JTA) to control transactions.
CORBA clients. Clients can also be written to the CORBA standard. This would primarily be useful if you want to call your EJB components using another language, such as C++. CORBA clients use the CORBA Naming Service (COS Naming) to look up objects over the network, and they use the CORBA�s Object Transaction Service (OTS) to control transactions. Whether you�re using CORBA or RMI-IIOP, your client code typically looks like this: 1. Look up a home object. 2. Use the home object to create an EJB object. 3. Call business methods on the EJB object. 4. Remove the EJB object.
So, to recap. Given a HTML web page, how can I extend or enhance it, potentially through some embedded "non-html", such that an EJB can be invoked. You can have an applet in an HTML page which can theoratically invoke an EJB, but that is not recommended. Normal practice is that HTML page calls a servlet on your web-server, and this servlet (which is a java program) invokes EJB.