Beginner question about JSF, JSP and Apache
Hi there,
I'm having a example page to test some stuff of JSF, like:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
<h:outputText value="#{helloWorld.outputText}"/>
</f:view>
using a managed bean... (in the faces-config.xml file I've defined the managed bean)
Ok.. at this point all is right!
My question is about the web.xml file!
In this file I had this code:
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
My doubt is: Why can't I do a mapping to a .jsp file? Why it gives me an error?
Ok so we map the .jsp files to .jsf (or .faces) ended url's... but if we try to get the page using a .jsp ended url.. it gives an error (org.apache.jasper.JasperException). Why?
How can we hide the user of using a .jsp ended url... something like giving a "resource not avaiable error"?
Thanks in advance.
Tiago.

