473,769 Members | 4,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to interact with a Live java process from php?

Hi,

My question is pretty much what the title describes. My situation is:
The essential task is to provide a service to web user. This service
can only be accessed from a java program on the backend, and this
program, unfortunately, is a 24/7 live process. My teammate is going
to write a php program to handle the front end request, so my question
is that, is it possible for such a design to work? If it is, how?

Any help is greatly appreciated!

Sophia

Jan 20 '06 #1
5 1601
Sophia wrote:
Hi,

My question is pretty much what the title describes. My situation is:
The essential task is to provide a service to web user. This service
can only be accessed from a java program on the backend, and this
program, unfortunately, is a 24/7 live process. My teammate is going
to write a php program to handle the front end request, so my question
is that, is it possible for such a design to work? If it is, how?

Any help is greatly appreciated!

Sophia


Your details are vague, so it's hard to answer your question.
I'll guess the "live 24/7" backend java process is a "java servlet"
running inside a jakarta-tomcat servlet server.

A jakarta servlet server is essentially a webserver, written in
the java programming language, that responds to the http protocol
(processes post and get requests) and usually, but not always,
runs on port 80.

To send get parameters to the doGet() function of the servlet,
you might use a url like:
http://yourdomain:8080/servletname/pasta/fazoole

Or, in your html page (which might be generated by php code on some
other server) you might have a form whose action handler makes a post
to the servlet, with
<form action="http://yourdomain:8080/servletname" method="post">
<input type="text" name="xyz">
<input type="submit">
</form>

.......in other words, interacting with a servlet is hardly any
different than interacting with an apache webserver.
The servlet that processes the posts and gets, in your case,
sounds like it is already written. You only need to write the
html that interacts with the servlet (or write the php that makes the html)

Servlets written in java a better suited to large complex programming
logic than php......in the minds of most java programmers anyway.
That last statement will probably generate some static on this group.
I work in both languages. And I do think there is a complexity threshold
beyond which java wins, below which php wins.

Jan 20 '06 #2
Thanks for your reply.
Sorry I was not very clear, what I meant as a 24/7 live process is a
spearate standalone java program, it needs to be running 24/7 to handle
task A(backend data processing) and task B (web user request), and both
tasks need to be handled by the same process ( for resources
conflicting reason). So in this scenario, java servelet won't
work(because it is managed by webserver). My current solution is to
have the php script communicate with the java program via unix sockets,
afterall, my problem is the classic inter-process communication.

Jan 20 '06 #3
Thanks for your reply.
Sorry I was not very clear, what I meant as a 24/7 live process is a
spearate standalone java program, it needs to be running 24/7 to handle
task A(backend data processing) and task B (web user request), and both
tasks need to be handled by the same process ( for resources
conflicting reason). So in this scenario, java servelet won't
work(because it is managed by webserver). My current solution is to
have the php script communicate with the java program via unix sockets,
afterall, my problem is the classic inter-process communication.

Jan 20 '06 #4
Thanks for your reply.
Sorry I was not very clear, what I meant as a 24/7 live process is a
spearate standalone java program, it needs to be running 24/7 to handle
task A(backend data processing) and task B (web user request), and both
tasks need to be handled by the same process ( for resources
conflicting reason). So in this scenario, java servelet won't
work(because it is managed by webserver). My current solution is to
have the php script communicate with the java program via unix sockets,
afterall, my problem is the classic inter-process communication.

Jan 20 '06 #5

"Sophia" <qu****@gmail.c om> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Thanks for your reply.
Sorry I was not very clear, what I meant as a 24/7 live process is a
spearate standalone java program, it needs to be running 24/7 to handle
task A(backend data processing) and task B (web user request), and both
tasks need to be handled by the same process ( for resources
conflicting reason). So in this scenario, java servelet won't
work(because it is managed by webserver). My current solution is to
have the php script communicate with the java program via unix sockets,
do you intent to continue to use
http://us2.php.net/manual/en/ref.sockets.php sockets? PHP has sockets
functions.
afterall, my problem is the classic inter-process communication.

Feb 9 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3700
by: Paul | last post by:
Hello, I am researching ideas for a long term project and am currently investigating Java's capability for processing live video feed. I wish to examine digital video feed in real time and do such operations as: i) Define all pixels as either foreground or background (depending on whether they have the same colour as the predefined background).
1
6918
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
0
5055
by: Bob Sanford | last post by:
I am working with php scripting under an apache-based web service in Windows. The "allow service to interact with desktop" feature is NOT checked for this service, and I don't want it to be. But I want an executable that I run from my script to be able to create a new process (using CreateProcess) where the new process CAN interact with the desktop (pop up a message box, etc...). I am hoping to do it by somehow modifying the settings and flags...
9
5043
by: Tommy Lu | last post by:
Hi, wondering if there is a way to interact the shell command with the C# program? For example, if I type c:\>ver it then suppose to return the version of the OS I am currently using... or c:\>systeminfo
6
1948
by: Ian Frawley | last post by:
Hello everyone I have written a Windows Service to monitor local and remote Processes/Applications. However I am stuck because if it is installed as a user account I cannot get it to interact with the desktop and therefore get the System.Diagnostics.Process.Responding of an app. But if I set it as a System account that interacts with the desktop I have all sorts of security issues. I frigged the Type field within the Services registry...
10
2512
by: Steve | last post by:
I want to make a web application that will run on my home server and would like to be able to have the web application interact with another, winforms application. For example, let's say I wanted to go to an aspx page, click a button called "open notepad", then on ther server machine I would like to have the web app interact with a service installed on my server that handles the execution of different files. Does that makes sense?
0
1672
by: wayne hamilton | last post by:
I'm having a problem Interacting with Command Line programs. I can read and write anything I want as long as I don't have to interact with a process once it's started. Originally I had been calling 'test.bat' directly, and in the latest incarnation (below) I am starting up cmd.exe and then writing the commands I want to execute to the command line that way. My problem is that I need to know if a program is waiting for input. In my batch...
1
10858
by: =?Utf-8?B?SEQ=?= | last post by:
hi, i recently bought a new laptop with vista home premium and downloaded windows live messenger but about 3 seconds after login, the program stops responding and needs to close down. I see a little java icon next to the msn icon appear on the bottom right corner but disappears with the msn icon after i close the program. It is when that java icon pops up that the program freezes/stops responding. I've tried everything from reinstalling to...
2
4183
by: =?Utf-8?B?SnJ4dHVzZXIx?= | last post by:
I just started using Windows Live OneCare, I had been using Norton, but was unable to fix the problems I was having. I have yet been unsuccessful with OneCare as well. I keep getting the same warning from OneCare, one is for Adware, the other is for a trojan, I clean both, but almost immediatly, I get the same warning? My Windows Defender is also shut down, not by me as I have no idea how to do this(or to turn it back on), but am still...
0
9586
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.