且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

没有war文件的JSP部署

更新时间:2023-11-17 22:56:22

仅当容器配置为在磁盘上扩展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.