没有war文件的JSP部署 [英] JSP deployment without war file

查看:114
本文介绍了没有war文件的JSP部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题是,我不想替换包含在"war"文件中的整个Web应用程序,只是因为单个JSP文件中需要进行更改.因此,可以将JSP页面部署到Web服务器上而不将其打包到"war"文件中吗?如果是这样,那么可以在哪些Web服务器上(以及如何)完成此操作?

The thing is that I do not want to replace an entire web app contained in "war" file just because there needs to be a change in a single JSP file. So is it possible to deploy JSP pages on to a Web Server without packaging it into the "war" file? If so then on which Web Servers can this be done (and how)?

实际上,我正在寻找像经典ASP或PHP这样的解决方案.在这些环境中,不需要特定的XML配置文件,也不需要将它们打包在扩展为目录的WAR文件中.如果要更改单个ASP/PHP页面,则只需将其上载到Web服务器,它们具有简单的目录布局.使用JSP可以做到吗?

Actually, I am looking for a solution like classic ASP or PHP. In these environments, there is no need for a specific XML configuration file, and they do not need to be packaged in a WAR file that gets expanded to a directory. If I were to change a single ASP/PHP page then I only need to upload that to the Web Server and they have a simple directory layout. Is that possible with JSP?

推荐答案

仅当容器配置为在磁盘上扩展WAR时(大多数情况下默认这样做),然后您可以直接在扩展的WAR文件夹中替换文件.如果容器不支持hotdeploy(大多数生产服务器配置不支持,至少如果它们由非常好的服务器管理员来管理),那么您还需要重新启动服务器.

Only if the container is configured to expand the WAR on disk (most by default do), then you can just replace the file directly in the expanded WAR folder. If the container doesn't support hotdeploy (most production server configs don't, at least if they are managed by a very good server admin), then you also need to restart the server.

更新:如果您不想使用WAR进行部署,而只想手动创建部署文件,则只需直接在deploy文件夹中创建必要的文件夹/文件即可.例如,在 Tomcat 7.0 中,它是与Servlet 3.0兼容的容器,只需在其/webapps文件夹中创建一个新的子文件夹.

Update: if you don't want to deploy with a WAR, but just want to manually create the deployment files, then just create the necessary folders/files in the deploy folder directly. In Tomcat 7.0 for example, which is a Servlet 3.0 compatible container, just create a new subfolder in its /webapps folder.

Tomcat
 |-- bin
 |-- conf
 |-- lib
 |-- logs
 |-- temp
 |-- webapps
 |    `-- jazz
 |         `-- page.jsp
 `-- work

它将以http://localhost:8080/jazz/page.jsp的形式提供.

如果您希望它像http://localhost:8080/page.jsp一样位于域根目录,则将子文件夹重命名为ROOT(是的,大写).您可以删除/重命名包含Tomcat默认主页的现有页面.

If you want it to be on domain root like so http://localhost:8080/page.jsp, then rename the subfolder to ROOT (yes, uppercased). You can just delete/rename the existing one which contains the Tomcat default homepage.

这篇关于没有war文件的JSP部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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