不可能吧, 不在WEB.xml里面配置是不可能被调用的,j2ee2.4的examples里面的配置里面有<listener>
<listener-class>listeners.ContextListener</listener-class>
</listener>
这段。
<listener-class>listeners.ContextListener</listener-class>
</listener>
这段。
解决方案 »
- jdbc连接SqlServer2008
- JAVA 这是什么问题啊?
- null id in cn.csdn.domain.UserBook entry (don't flush the Session after an excep
- 使用java操作dbf文件的方法
- 谁能发本J2EE WITHOUT EJB给我
- 一个关于正则表达式的问题,急
- 老调重弹-怎样选择开源免费数据库
- tomcat控制台不打印后出现的问题
- 在用java做一个小项目时遇到的问题,关于socket的请高手过来看看,怎么做最好
- 大家都是搞J2EE的,觉得.NET与J2EE相比有哪些优劣势?凭心而论!!
- 问个笨问题:由hibernate查询到的List,可以直接让display-tag读取然后显示么? [结合struts]
- webwork中怎么在interceptor中得到正运行的action 的名字???
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
"-//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>
FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);就和sun的实现发生绑定了,到底它是怎么知道在哪里加载sun的实现类的呢?
<!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还是能被调用呢?