我正在使用 Spring 3.2.2、hibernate 4.2.2 和 JSF 2.1 (mojora) 和 RichFaces 4.3.2 运行应用程序
我的配置运行良好。我可以通过 .xhtml,.jsf,.jsp 访问页面,但是...
当您尝试访问一个不存在的页面(例如 blabla.xhtml 未创建)时,问题就出现在显示屏上。如何处理错误?
谢谢大家帮助。
这是错误,这将导致无限递归:
ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
这是我的 web.xml :
<!-- Welcome page -->
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<!-- JSF Mapping -->
<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>*.jsf</url-pattern>
<url-pattern>*.xhtml</url-pattern>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<!-- Change to "Production" when you are ready to deploy -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!-- Faces ConfigPath Context -->
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>classpath:webConfiguration/faces-config.xml</param-value>
</context-param>
<!-- Add Spring Context -->
<context-param>
<param-name> contextConfigLocation </param-name>
<param-value>classpath:webConfiguration/applicationContext.xml</param-value>
</context-param>
<!-- Apache EL Faces Context -->
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>
<!-- Richfaces Skin Context -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>laguna</param-value>
</context-param>
<!-- Add Support for Spring -->
<listener><listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class></listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class></listener>