Two methods for php to call Java objects

Source: Internet
Author: User
Tags php compiler
1. Java Module of php the php announced version contains a Java expansion module that can be used to call Java objects, such :? Php $ system = newJava ("java. lang. System"); print "Javaversion =". $ system-getProperty ("java. version ")."";? 2. mi 1. Java Module of php

Php announced that the version contains a Java extension module that can be used to call Java objects. for example:

$ System = new Java ('Java. lang. system ');
Print 'Java version = '. $ system-> getProperty ('Java. version ').'
';
?>


2. minij2ee is implemented using the server SJOP protocol

Minij2ee using the server to achieve the SJOP protocol is an important goal is to enable php to visit EJB enterprise-level components, so minij2ee provides a EJB-PHP compiler, can compile EJB components into php class, this allows php programs to conveniently call EJB components, for example:

Require ('cart. php'); // Cart. php is the php class definition of Cart EJB after the Cart EJB is compiled.
.

$ Home = new CartHome (); // create the Home interface of EJB.
$ Objref = $ home-> create ($ cart_name); // create Cart EJB.
$ Cart = new Cart ($ objref );

$ Cart-> add ('Some goods '); // add an item to the cart.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.