如何找到JSF页面的正确URL?在IntelliJ IDEA中打开会导致404 [英] How to find out right URL to JSF page? Opening in IntelliJ IDEA causes 404
问题描述
我是Java Web开发人员的新手。在intellij Idea 14上,我开始了一个带有普通Java,JSF支持的新项目(没有JavaEE,稍后会添加Spring)。 Tomcat 7.0.59作为服务器。当我在IDE上运行时,firefox打开并点击 http:// localhost:8080 / index.xhtml ',它应该显示IDE在新项目上创建的index.xhtml中的hello world,但页面只显示'HTTP 404'。
I'm very new on Java Web dev. On intellij Idea 14, I started a new project with plain Java, JSF support (no JavaEE, will add Spring later). Tomcat 7.0.59 as server. When I hit run on the IDE, firefox opens up and hits on 'http://localhost:8080/index.xhtml', it should display the hello world in index.xhtml that the IDE makes on new project, but the page just displays 'HTTP 404'.
我认为问题是浏览器上的路径,我如何找到正确的路径并在IDE部署设置上进行配置?如何在tomcat上调试?我在哪里可以开始查看?
I think the problem is path on the browser, how can I find the correct path and configure it on IDE deploy settings?, how can I debug on tomcat?, where can I start looking?
推荐答案
http:// localhost:8080 / index.xhtml 是一个不完整的地址。上下文根在哪里?它应该是您的项目/ web应用程序的名称,您将拥有
http://localhost:8080/index.xhtml is an incomplete address. Where is the context root? It should be the name of your project/webapplication, where you would have
http:// localhost:8080 / {application-name} /index.xhtml。
"http://localhost:8080/{application-name}/index.xhtml".
除非您将应用程序设置为默认值tomcat应用程序(我非常怀疑),你应该在URL中有你的项目名称
Unless you've set your application to be the default tomcat application (which I highly doubt), you should have the name of your project in there in the URL
这篇关于如何找到JSF页面的正确URL?在IntelliJ IDEA中打开会导致404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!