不可能吧, 不在WEB.xml里面配置是不可能被调用的,j2ee2.4的examples里面的配置里面有<listener>
<listener-class>listeners.ContextListener</listener-class>
</listener>
这段。
<listener-class>listeners.ContextListener</listener-class>
</listener>
这段。
解决方案 »
- WebSphere下客户端请求Werservice报错
- 急。。。服务器访问超慢。。。
- cvs网上怎么从别人的电脑上把项目拿下来
- 【结贴率100%高分求解】WEBSERVICE取byte[] 内存溢出问题 (大概是这样)
- 求职···!
- 再问一个SOAP的问题
- 救命,开发问题 MyEclipse 10.0 新建不了web project
- 100分求一个eclipse(lomboz)+jboss+j2sdk1.4.2_x开发的jsp程序(jsp文件可以发布到jboss)
- 老师出了一题和网络联系起来的java题目,要考察我们实际的能力,现在贴上来,与大家讨论这道题目的解法
- 哪位知道哪里有将面页列表转换成DBF格式的Java工具?
- 问个笨问题:由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还是能被调用呢?