How to find out right URL to JSF page? Opening in

2019-09-02 21:44发布

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'.

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?

3条回答
Luminary・发光体
2楼-- · 2019-09-02 22:20

move the lib directory into WEB-INF

查看更多
\"骚年 ilove
3楼-- · 2019-09-02 22:31

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".

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

查看更多
一夜七次
4楼-- · 2019-09-02 22:31

%CATALINA_HOME% is Tomcat install directory. Use %CATALINA_HOME%\logs to read Tomcat log for debugging.

When you create a new Java web project, It also means you are diving to Java EE (Enterprise Edition).

Create new JSF web application by IntelliJ IDEA:

enter image description here Offical tutorial for you: http://docs.oracle.com/javaee/7/tutorial/partwebtier.htm#BNADP .
You should use GlassFish 4 application server for simplicity at first one.

查看更多
登录 后发表回答