LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-04-2008, 10:15 AM   #1
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Rep: Reputation: 30
PHP needs to interact with Java Library. Suggestions?


I have been creating a web page that is based on PHP/Smarty. I have recently came to a realization that the web page will need to interact with a Java library. My problem is that the interaction is too detailed to create an executable with the JAR, and I am not sure how to go about interacting with this library. Basically, I have a list of user input in a PHP/Smarty form, that needs to be used in this java library. Any suggestions on how to do this? This is what I am thinking, but it seems a little unconventional:

Present the form to the user, when the user submits, it passes to Tomcat, which deals with the POST data, and interacts with the JAR file.

Any other ideas? Thanks.
 
Old 01-04-2008, 06:27 PM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
There are a couple of ways to achieve what you want, however I must say up front I've never tried to integrate Java & PHP, however look up the chapter in the ever friendly PHP manual called: PHP / Java Integration. The introduction reads as follows:

"There are two possible ways to bridge PHP and Java: you can either integrate PHP into a Java Servlet environment, which is the more stable and efficient solution, or integrate Java support into PHP. The former is provided by a SAPI module that interfaces with the Servlet server, the latter by this Java extension.

The Java extension provides a simple and effective means for creating and invoking methods on Java objects from PHP. The JVM is created using JNI, and everything runs in-process."

I hope the chapter helps you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Gnutella Java Library? hamtavs Programming 1 02-13-2007 03:57 PM
unix korn shell script that interact with windows java program ann124 Programming 5 11-09-2004 09:14 PM
Is it possible to interact with java program on web by using PHP? antony_csf Programming 8 06-25-2004 09:28 AM
java library problem sbrattt Programming 12 04-30-2002 11:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration