如何将java项目作为后端运行? [英] How do I run a java project as a backend?

查看:876
本文介绍了如何将java项目作为后端运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个java项目。我想创建一个接口,以便当人们在表单中输入一些文本并提交它时,该文本将传递给test.java(java项目中的一个文件),并对其执行一个操作,对其给出响应,是1还是0.

基本上我必须将php变量的值传递给java项目。我是初学者。我用谷歌搜索并阅读了一些关于RESTful API的内容,但是没有太多意义。如果我得到一些帮助会很棒。

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.

推荐答案

您是否考虑过使用JSP代替PHP? JSP页面(包含HTML代码)可以直接与JAVA后端交互,也称为Servlet。
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.


这篇关于如何将java项目作为后端运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆