• 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

EJB from HTML

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

How can I invoke a session EJB from an HTML page?

Cheers,

Si.
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, HTML is a static presentation language .... technically, it doesn't do anything. So, the question is, what can you embed in HTML that has the capability to interface with EJB ...
 
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Simon Cockayne
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Yes I should have been more specific. I attempted to imply that I have a HTML page (which cannot of itself invoke an EJB), moreover, the implication should have been, what can exist within an HTML page that can invoke an EJB. I.e. javascript or some other candidate.

I have seen examples of javascript being able to invoke an EJB, but only with Netscape, not Microsoft Internet Explorer. (Note I wish to use IE).

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.

Kind regards,

Si.
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have seen examples of javascript being able to invoke an EJB, but only with Netscape, not Microsoft Internet Explorer. (Note I wish to use IE).

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.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I have seen examples of javascript being able to invoke an EJB, but only with Netscape, not Microsoft Internet Explorer. (Note I wish to use IE).


Yeah?! You couldn't post one of these examples could you? Because thats
something I've never seen.
 
Simon Cockayne
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is an example of javascript calling EJB for netscape:

http://docs.sun.com/source/816-6120-10/ejbscrip.htm#522004

Cheers,

Simon.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, you mean with serverside JavaScript. That makes sense now. You do realize that "Netscape" in this instance refers to Netscape Application Server (or iPlanet as its now known), not Netscape Internet Browser?
reply
    Bookmark Topic Watch Topic
  • New Topic