简体   繁体   English

在Eclipse / Tomcat上启动Servlet会打开错误的URL

[英]Launching Servlet on Eclipse/Tomcat opens the wrong URL

Everytime I click on Run on Server it builds my servlet and opens the browser, but with the wrong URL. 每次我单击Run on ServerRun on Server都会构建我的servlet并打开浏览器,但是URL错误。 The URL called is 所调用的网址是

http://localhost:8080/myproject/

but this leads to an error 404, because the correct URL is 但这会导致错误404,因为正确的网址是

http://localhost:8080/MyProject/

case-sensitive. 区分大小写。

The context root is set to MyProject . 上下文根设置为MyProject I stopped the server, cleared the tomcat workdirectory and published it several times, but Eclipse still calls the lower-cased URL. 我停止了服务器,清除了tomcat工作目录并发布了几次,但是Eclipse仍然调用小写的URL。 Also tried switching the tomcat location from [workspace metadata] but this doesn't helped either. 还尝试从[workspace metadata]切换tomcat的位置,但这也没有帮助。

EDIT: Using Eclispe Luna 4.4.0 , Tomcat v7.0 , Vaadin 7.4.0 and Maven 编辑:使用Eclispe Luna 4.4.0Tomcat v7.0Vaadin 7.4.0Maven

Check your project's properties. 检查项目的属性。 There should be an entry for "Web App" or similar where you can specify the context URL. 应该有一个用于“ Web App”或类似名称的条目,您可以在其中指定上下文URL。

If you can't find it, search for myproject in the folder .settings of your project. 如果找不到,请在项目的.settings文件夹中搜索myproject

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

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