Eae galera…
Gostaria de saber como mapeamos nossos controles em JSF…
Em Spring normalmente se faz assim:
[code]
Name_Servlet
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
/WEB-INF/spring-context/servlet-*.xml
1
<servlet-mapping>
<servlet-name>Name_Servlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>[/code]
Logo, da raiz de sua app, vc poderá acessar seus controller… desde que estejam mapeados claro…
Quero saber apenas como configuramos este ‘DispatcherServlet’ em JSF, como falo para ele que meus controllers mapeados podem ser acessados por ‘x’ diretorio…
Estou trabalhando com Spring 3 + JSF 1.2
Fiz o mapeamento, deste jeito ai em cima com Spring, mais quando eu coloco no diretorio raiz, não funciona… da erro 404, provavelmente por causa que o JSF não conseguiu fazer seu mapeamento…
Meu web.xml esta assim:
[code]<?xml version="1.0" encoding="UTF-8"?>
<display-name>Core_base</display-name>
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<!-- ##________________________ JSF 2 ________________________## -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
/WEB-INF/faces-config/faces-config.xml,
/WEB-INF/faces-config/faces-managed-beans.xml,
/WEB-INF/faces-config/faces-navigation.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.enabledLoadBundle11Compatibility</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jspx</param-value>
</context-param>
<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>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!-- ##________________________ LOG4J ________________________##
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/classes/log4j.properties</param-value>
</context-param>-->
<!-- ##________________________ Spring 3 ________________________## -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring-context/spring-context-*.xml
</param-value>
</context-param>
<!-- ## ___ Spring 3 > Listener ___## -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!--<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>-->
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<!-- ## ___ Spring 3 > Filter ___## -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<!--
- Servlet that dispatches request to registered handlers (Controller
implementations). - Has its own application context, by default
defined in "{servlet-name}-servlet.xml", - i.e. "bwsuite-servlet.xml".
- - A web app can contain any number of such servlets. - Note that
this web app has a shared root application context, serving as parent
- of all DispatcherServlet contexts.
-->
<servlet>
<servlet-name>Core_base</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring-context/servlet-*.xml
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Core_base</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!--
- Map static resources to the default servlet
- examples:
- http://localhost:8080/static/images/logo.png
- http://localhost:8080/static/styles/custom.css
-->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>
[/code]
Se alguem puder dar uma ajuda ae… !!!
Valeu!