JSF中没有配置监听器为什么ConfigureListener还是能被调用呢

06-05-18 ppm10103
JSF1.1的sun实现的guessNumber的例子

web.xml代码:

<!DOCTYPE web-app PUBLIC

"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

<display-name>JavaServer Faces Guess Number Sample Application</display-name>

<description>

JavaServer Faces Guess Number Sample Application

</description>

<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.validateXml</param-name>

<param-value>true</param-value>

<description>

Set this flag to true if you want the JavaServer Faces

Reference Implementation to validate the XML in your

faces-config.xml resources against the DTD. Default

value is false.

</description>

</context-param>

<context-param>

<param-name>com.sun.faces.verifyObjects</param-name>

<param-value>true</param-value>

<description>

Set this flag to true if you want the JavaServer Faces

Reference Implementation to verify that all of the application

objects you have configured (components, converters,

renderers, and validators) can be successfully created.

Default value is false.

</description>

</context-param>

<!-- Faces Servlet -->

<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>/guess/*</url-pattern>

</servlet-mapping>

<security-constraint>

<!-- This security constraint illustrates how JSP pages

with JavaServer Faces components can be protected from

being accessed without going through the Faces Servlet.

The security constraint ensures that the Faces Servlet will

be used or the pages will not be processed. -->

<display-name>Restrict access to JSP pages</display-name>

<web-resource-collection>

<web-resource-name>

Restrict access to JSP pages

</web-resource-name>

<url-pattern>/greeting.jsp</url-pattern>

<url-pattern>/response.jsp</url-pattern>

</web-resource-collection>

<auth-constraint>

<description>

With no roles defined, no access granted

</description>

</auth-constraint>

</security-constraint>

</web-app>

上面并没有配置监听器,但是看看下面的内容

Thread: main

<init>() : 98, com.sun.faces.application.ApplicationAssociate, ApplicationAssociate.java

<init>() : 98, com.sun.faces.application.ApplicationImpl, ApplicationImpl.java

getApplication() : 74, com.sun.faces.application.ApplicationFactoryImpl, ApplicationFactoryImpl.java

application() : 384, com.sun.faces.config.ConfigureListener, ConfigureListener.java

configure() : 427, com.sun.faces.config.ConfigureListener, ConfigureListener.java

configure() : 402, com.sun.faces.config.ConfigureListener, ConfigureListener.java

contextInitialized() : 332, com.sun.faces.config.ConfigureListener, ConfigureListener.java ---------是一个监听器

listenerStart() : 3669, org.apache.catalina.core.StandardContext, StandardContext.java

start() : 4104, org.apache.catalina.core.StandardContext, StandardContext.java

start() : 1012, org.apache.catalina.core.ContainerBase, ContainerBase.java

start() : 718, org.apache.catalina.core.StandardHost, StandardHost.java

start() : 1012, org.apache.catalina.core.ContainerBase, ContainerBase.java

start() : 442, org.apache.catalina.core.StandardEngine, StandardEngine.java

start() : 450, org.apache.catalina.core.StandardService, StandardService.java

start() : 683, org.apache.catalina.core.StandardServer, StandardServer.java

start() : 537, org.apache.catalina.startup.Catalina, Catalina.java

invoke0() : -1, sun.reflect.NativeMethodAccessorImpl, NativeMethodAccessorImpl.java

invoke() : 39, sun.reflect.NativeMethodAccessorImpl, NativeMethodAccessorImpl.java

invoke() : 25, sun.reflect.DelegatingMethodAccessorImpl, DelegatingMethodAccessorImpl.java

invoke() : 585, java.lang.reflect.Method, Method.java

start() : 271, org.apache.catalina.startup.Bootstrap, Bootstrap.java

main() : 409, org.apache.catalina.startup.Bootstrap, Bootstrap.java

这个web.xml没有配置监听器为什么监听器ConfigureListener还是能被调用呢?

猜你喜欢