Tomcat服务器上的Intellij Web应用程序显示http://localhost:8080/index.jsp而不是http://localhost:8080/myapp/index.jsp [英] Intellij web application on tomcat server shows http://localhost:8080/index.jsp instead of http://localhost:8080/myapp/index.jsp

查看:653
本文介绍了Tomcat服务器上的Intellij Web应用程序显示http://localhost:8080/index.jsp而不是http://localhost:8080/myapp/index.jsp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注有关udemy的教程.在本教程中,他正在使用eclipse.但是我正在跟intellij一起学习.一切正常,但我要注意的一件事是,当他运行servlet或jsp页面时,它总是在servlet之前显示项目名称( http://localhost:8080/myapp/index.jsp ). 但是,当我在intellij上创建Web应用程序时,它仅显示 http://localhost:8080/index.jsp

I'm following a tutorial on udemy. In the tutorial he is using eclipse. But i'm following the course with intellij. Every thing works fine but one thing i keep noticing is that when he runs the servlets or jsp pages it is always shows the project name before the servlet(http://localhost:8080/myapp/index.jsp). But when i create an web application on intellij it just shows http://localhost:8080/index.jsp.

所以问题是如何获得/index.jsp之前的项目名称.

So the question is how can get the project name before the /index.jsp.

我试图将其添加到web.xml文件中,但它似乎不起作用

I tried to add this to the web.xml file but it does not seems to work

<display-name>myApp</display-name>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

推荐答案

您可以在tomcat服务器的编辑配置"中输入应用程序URL.

You can enter your application URL in the 'Edit Connfiguration' of your tomcat server.

  • 点击编辑配置"
  • 在启动页面中输入您的应用程序URL

注意:-上面的解决方案很可能会起作用,如果不能解决,则可能需要在部署"选项卡中将应用程序上下文更改为"\ myApp".

Note:- Most probably above solution will work, if it doesn't then you might need to change the application context to '\myApp' in deployment tab.

这篇关于Tomcat服务器上的Intellij Web应用程序显示http://localhost:8080/index.jsp而不是http://localhost:8080/myapp/index.jsp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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