Click here to Skip to main content
15,878,814 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I have a java project. I want to create an interface so that when people enter some text in a form and submit it, that text is passed to test.java(a file in the java project) and an operation is performed on it to which a response is given which is either 1 or 0.
Basically I have to pass the value of php variable to java project. I'm a total beginner. I googled and read something about RESTful API but couldn't make much sense out of it. It would be great if I get some help.
Posted
Comments
Mohibur Rashid 25-Jul-15 13:07pm    
What platform?
Member 11849526 27-Jul-15 2:21am    
maven and jetty

1 solution

Have you considered using JSP instead of PHP? JSP pages (which contain you HTML code) can interact directly with a JAVA backend, also called Servlets.
 
Share this answer
 
Comments
anaQata 31-Jul-15 9:19am    
Does that mean running servlets with PHP brings along problems or requires hefty coding?
Max Methot 31-Jul-15 10:04am    
I am not a PHP pro, but I think mixing PHP and Java isn't as trivial as it may sound. A quick Google search brought some results about a PHP to Java "bridge", but that sounds kind of messy to me. If you really have to use a JAVA backend, I would definitely go with a JAVA+JSP web application rather than using a PHP frontend.
anaQata 31-Jul-15 10:47am    
This stark-overflow post has some pretty nice replies...

http://stackoverflow.com/questions/13897290/hosting-php-and-java-together
Max Methot 31-Jul-15 10:56am    
Indeed, but it is still a "workaround".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900