简体   繁体   English

如何在服务器上部署/上传JSP文件

[英]How to deploy/upload a JSP file on Server

I have created a jsp file which will give an output in JSON format using java class and servlet, i am new to java and i don't have idea about the deployment of jsp file. 我创建了一个jsp文件,该文件将使用java类和servlet给出JSON格式的输出,我是java的新手,并且我不了解jsp文件的部署。 Can anyone suggest me how to do it? 谁能建议我该怎么做? I used to develop an asp.net web application in which there was a specific option available which called " publish project", but i cant find in eclipse. 我曾经开发过一个asp.net Web应用程序,其中有一个称为“发布项目”的特定选项,但是我在eclipse中找不到。 I already have a php server in which i have uploaded few php files, can i use the same server to upload this file? 我已经有一个php服务器,其中已经上传了几个php文件,我可以使用同一台服务器上传该文件吗?

Currently, my application is running fine on localhost. 目前,我的应用程序在localhost上运行良好。

Please help me with this matter and thank you for your time. 请帮助我解决此问题,并感谢您的宝贵时间。

To publish your project in Eclipse: 要在Eclipse中发布项目:

  1. Right click your project 右键单击您的项目
  2. Export 出口
  3. Under Web > Choose WAR 在Web下>选择WAR
  4. Then just follow the instructions and your good to go. 然后,按照说明操作即可。

It is done as a component of a WAR (Web Application Archive) file. 它是作为WAR(Web应用程序存档)文件的组件完成的。

Upon deployment, JSP files are processed by the Servlet container. 部署后,JSP文件由Servlet容器处理。 The processing effectively turns them into Servlets, such that the plain text of the JSP becomes println statements in the response of the Servlet, and the embedded Java code in the JSP becomes regular Java code in the Servlet. 该处理有效地将它们转换为Servlet,以使JSP的纯文本成为Servlet响应中的println语句,而JSP中的嵌入式Java代码成为Servlet中的常规Java代码。

The packaging details are covered in detail in the JEE7 tutorial , although earlier tutorials don't differ much in the details. JEE7教程详细介绍了包装详细信息 ,尽管较早的教程在细节上并没有太大差异。

i assume you are using tomcat in your php? 我认为您在php中使用tomcat? you can use tomcat or glassfish server to deploy your application. 您可以使用tomcat或glassfish服务器来部署您的应用程序。 you just need the .war file of your application and upload it to the admin page of tomcat or glassfish server. 您只需要应用程序的.war文件,并将其上传到tomcat或glassfish服务器的管理页面即可。

It should be in .war file format 它应该是.war文件格式

Here are few links which can help you in building it from eclipse, link1 , link2 . 这里有一些链接可以帮助您从eclipse, link1link2进行构建。

For deployment, there should be a server -- tomcat / glassfish / jboss which can provide platform to execute .war files. 为了进行部署,应该有一个服务器-tomcat / glassfish / jboss,它可以提供执行.war文件的平台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM