调整 Eclipse 动态 Web 项目以在真实服务器中拥有站点的步骤
我在 eclipse 和 tomcat 5.5 上编写了一个小型 servlet 和 jsp 项目,但我不知道我所做的工作是为了使其成为真实主机上的真实站点。我应该与他们作战还是应该在主机上上传项目?我的主机应该具有哪些属性?我现在真的不知道如何开始?
I wrote a small servlet
and jsp project on eclipse and tomcat 5.5
, but I don't know with works I do for make that a real site on a real host. Should I war them or I should upload project on host? My host should have which properties? I really don't now how to start?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议将它们打包成 war 并将其部署到远程 tomcat 服务器。除非您进行调试或测试,否则将未打包的项目直接部署到服务器并不是一个好主意。一旦您完成了项目,就可以将其部署到 war 中。我通常使用 tomcat 管理器页面部署到服务器。只需浏览战争,单击上传按钮,它就会立即启动。在我的本地计算机上,这是我用来上传到服务器的网址 http://localhost:8080/manager 。服务器本身应该具有与您在 Eclipse 工作区中使用的属性和设置相同的属性和设置,并且我强烈建议它也具有相同的版本。还可以将 war 放入远程主机上的目录中,Tomcat 将在启动时加载该目录,该位置将根据主机的不同而有所不同。
I would recommend packaging them in a war and deploying it out to the remote tomcat server. Its not a good idea to deploy an unpackaged project directly to the server unless your debugging or testing. Once you have a finished project ready to deploy package it to a war. I typically deploy to server using the tomcat manager page. Just browse for the war, click the upload button and it should start right up. On my local machine this is the url that I use to upload to the server http://localhost:8080/manager. The server itself should have the same properties and settings that you are using in your eclipse workspace, and I would highly recommend that it be the same version as well. The war can also be dropped into a directory on the remote host and Tomcat will load this on startup, this location will vary depending on the host.