Intellij IDEA Web项目部署 [英] Intellij IDEA Web Project deployment

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

问题描述

在Intellij IDEA中从零开始创建一个新的Java Web项目,在此处没有更改,并且发现我的项目默认启动在 localhost:8080 / ,而不是Eclipse,NetBeans,例如,项目从 localhost:8080 / WEB_PROJECT_NAME 开始。

Created a new Java Web Project from a scratch in Intellij IDEA, changed nothing here, and found out that my project starts by default at localhost:8080/ in contrast to Eclipse, NetBeans, for example, where the project starts at localhost:8080/WEB_PROJECT_NAME.

事情是默认文件index.jsp始终正确显示在 localhost:8080 / index.jsp
但是我总是遇到404错误,试图访问 localhost:8080 / WEB_PROJECT_NAME / index.jsp

The thing is that the default file index.jsp is always correctly displayed at localhost:8080/index.jsp But I always got a 404 error, trying to access localhost:8080/WEB_PROJECT_NAME/index.jsp

因此,我没有机会运行任何servlet或其他。
我尝试通过localhost访问的任何内容:8080 / WEB_PROJECT_NAME / ...给我一个错误。

Therefore, I have no opportunity to run any servlets or smth else. Anything I try to access via localhost:8080/WEB_PROJECT_NAME/... gives me an error.

这是我的运行/调试配置:

Here are my Run/Debug configurations:

推荐答案

点击部署标签如图所示,您可以在那里指定Web应用程序的上下文,lile / WEB_PROJECT_NAME 而不是默认的 / (ROOT)。

Click on the Deployment tab shown on your screenshot, you can specify the context for your web application there, lile /WEB_PROJECT_NAME instead of the default / (ROOT).

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

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