jsf+hibernate+spring 配置后,页面打不开

xuan_myg 2008-04-25
type Status report

message /JsfAnd/welcome.faces

description The requested resource (/JsfAnd/welcome.faces) is not available.


web.xml 配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  <!-- Application Name -->
<display-name>JsfAnd</display-name>
  <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
  </context-param>
  <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
  </listener>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>index.faces</welcome-file>
  </welcome-file-list>
 
  <filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    <init-param>
      <param-name>maxFileSize</param-name>
      <param-value>20m</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.faces</url-pattern>
  </filter-mapping>
  <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:*.xml</param-value>
</context-param>

<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>

<!--Schemer of Spring refreshing Log4j config files,Unit is millisecond-->
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>60000</param-value>
</context-param>

<!-- See description -->
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>

</context-param>



<!-- See description -->
<context-param>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>

</context-param>



<!-- See description -->
<context-param>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>false</param-value>

</context-param>

<!-- Famous Character Encoding filter -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>


<!-- Open Session in View Filter  -->
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>

<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.faces</url-pattern>
</filter-mapping>



<!--Spring Context loader-->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>

<!-- Listener, that does all the startup work (configuration, init). -->
<listener>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener
</listener-class>
</listener>

<!--
Publish HttpSessionApplicationEvents & HttpSessionDestroyedEvent event to spring applicationcontext
-->
<listener>
<listener-class>
org.acegisecurity.ui.session.HttpSessionEventPublisher
</listener-class>
</listener>

<!-- Release of the web app class loader and the classes that it holds -->
<listener>
<listener-class>
org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener>

<!-- Spring log4j Config loader-->
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>

<!-- Faces Servlet, process files end with .htm as MyFaces -->
<servlet>
<!-- Faces Servlet -->
<servlet-name>faces</servlet-name>
<servlet-class>
org.apache.myfaces.webapp.MyFacesServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>



<servlet-mapping>
<!-- Faces Servlet Mapping -->
<servlet-name>faces</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>

<jsp-config>
<taglib>
<taglib-uri>
http://www.springside.org.cn/taglibs
</taglib-uri>
<taglib-location>
/WEB-INF/tld/springside.tld
</taglib-location>
</taglib>
</jsp-config>
</web-app>

tailsherry 2008-04-28
welcome.jsp在是否存在你的发布web目录下?
terryzhou 2008-05-04
强列建议你把spring和hibernate的配置先去掉..一步步来..先试jsf..
另外同楼上问,文件在么?
aidiyuxin 2008-05-07
你的welcome 不对吧
应该用一个.jsp转向jsf页面的
要不,不会经过恢复视图的
a3mao 2008-05-07
后缀是 .faces 不是jsp或者jsf,你的配置文件里写的
terryzhou 2008-05-07
description The requested resource (/JsfAnd/welcome.faces) is not available.

楼上的,看清楚这行
Global site tag (gtag.js) - Google Analytics