Reputation: 831
I am geting used to be Java programmer, and I've just taught servlets. But IDEA ctreates index.jsp, when I choose "Create Web Application". I've run into one article where found out from about JSF. It was described as a better and newest version of WebApp desiging. I've written a project where index.jsp are used (web->src->main->webapp) inside this path. It was created by IDEA. Now I wanna substitude JSP with XHTML. I've done it, assebled my project and deployed. But when I go to
localhost:8080/web/
I see nothing. When I use "index.JSP", I can see content of my JSP-page. Please, help me to correct my project. What should I do?
Upvotes: 0
Views: 572
Reputation: 1855
In order to make JSF working, you have some configuration to do:
<?xml version='1.0' encoding='UTF-8'?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
</faces-config>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
</web-app>
Using this configuration, you must put your JSF at the same level as WEB-INF and give them the extension .xhtml. Of course you can set the pattern.
JSF is not only make to replace JSF files. This is a big framework which allow you to write only the business logic. You will need to learn more about JSF before using it. Take a look right here.
Upvotes: 2