简体   繁体   English

如何在 glassfish 服务器中部署 web 应用程序和 web 服务

[英]how to deploy web application and web service in glassfish server

I want to deploy web application and web service in a glassfish server.我想在 glassfish 服务器中部署 web 应用程序和 web 服务。 How can I do it?我该怎么做? can I deploy two applications on different port?我可以在不同的端口上部署两个应用程序吗? I can't combine the web application and RESTful web service.我无法将 web 应用程序和 RESTful web 服务结合起来。

thanks谢谢

Web apps and Jersey web services are both deployed in WARs. Web 应用程序和 Jersey web 服务都部署在 WAR 中。 So, you have several options.所以,你有几个选择。

You can combine the two in to a single web app, and deploy a single WAR.您可以将两者组合到一个 web 应用程序中,然后部署一个 WAR。

You can deploy them in separate WARs, with separate contexts (ie /war1, /ws2).您可以将它们部署在具有单独上下文(即/war1、/ws2)的单独WAR 中。

You can create a new virtual server (which can listen on any port) and one WAR to each, and then they can both be using the same context, they're just use different hosts and/or ports.您可以创建一个新的虚拟服务器(可以侦听任何端口)和一个 WAR,然后它们都可以使用相同的上下文,它们只是使用不同的主机和/或端口。

It's not clear what problem you're having or what you're trying to do, but those are the three main options available to you.目前尚不清楚您遇到了什么问题或您正在尝试做什么,但这些是您可以使用的三个主要选项。

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

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