简体   繁体   English

如何将使用eclipse和tomcat构建的Java EE项目部署到万维网?

[英]How to deploy a Java EE project built using eclipse with tomcat to world wide web?

How to deploy a Java EE project built using eclipse with tomcat to world wide web? 如何将使用eclipse和tomcat构建的Java EE项目部署到万维网? This is my first time that I've built a java EE project and now I need to deploy it into the internet, how can I do it? 这是我第一次构建Java EE项目,现在需要将其部署到Internet中,该怎么办? And my project has a large database that needs to be included, and it is made in mysql workbench 我的项目有一个需要包含的大型数据库,它是在mysql工作台中完成的

First, you need to create a war file, if you use eclipse, you have to go to File > Export > Web > WAR File and follow the steps. 首先,您需要创建一个war文件,如果使用eclipse,则必须转到File> Export> Web> WAR File,然后按照以下步骤操作。 After that, you put your WAR file into [Home Tomcat]/WebApss or you can load your WAR file with the web console of Tomcat. 之后,您可以将WAR文件放入[Home Tomcat] / WebApss中,也可以使用Tomcat的Web控制台加载WAR文件。 Now, I don't know how you connect to your databse, if you have your connection with jdbc in your code, then you don't need to configure something else, but if you have a JNDI for your connection, you need to configure the context in your [Home Tomcat]/conf/server.xml file, for example: 现在,我不知道您如何连接到数据库,如果您在代码中与jdbc建立了连接,则无需配置其他内容,但是如果您有用于连接的JNDI,则需要配置[Home Tomcat] /conf/server.xml文件中的上下文,例如:

<Context>
       <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
               maxActive="100" maxIdle="30" maxWait="10000"
               username="javauser" password="javadude" driverClassName="com.mysql.jdbc.Driver"
               url="jdbc:mysql://localhost:3306/javatest"/>

</Context>

This is the basic configuration for your server and web application, if you need another kind of configuration like security, I recommend you visit the official site of Tomcat. 这是服务器和Web应用程序的基本配置,如果您需要其他类型的配置(如安全性),建议您访问Tomcat的官方站点。

I hope this information helps you. 希望这些信息对您有所帮助。

Good Luck. 祝好运。

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

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