JSF中沒有配置監聽器為什麼ConfigureListener還是能被呼叫呢
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還是能被呼叫呢?
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還是能被呼叫呢?
相關文章
- 既然synchronized是"萬能"的,為什麼還需要volatile呢?synchronized
- 網站為什麼會卡,是伺服器原因還是其他原因呢網站伺服器
- 為什麼前端不能沒有監控系統?前端
- 用了HTTPS,沒想到還是被監控了HTTP
- QTP中為什麼恢復場景(Recovery Scenario)沒有被觸發?QT
- 手機沒網了,卻還能支付,這是什麼原理?
- 你有沒有想過: 為什麼Java中String是不可變的?Java
- 為什麼有時使用高匿海外IP代理還是會被檢測到?
- 你用的32位還是64位?有什麼區別呢?
- 沒有記憶體,怎麼還能跑程式呢記憶體
- jdon framework 為什麼沒有用Event Source 呢Framework
- oracle 監聽器配置Oracle
- 【MOS:1549181.1】為何在查詢中索引未被使用--為什麼索引沒有被使用索引
- 為什麼Hook沒有ErrorBoundary?HookErrorORB
- 為什麼Google沒有客服?Go
- 企業為什麼選擇伺服器呢?有什麼優勢嗎?伺服器
- Current without potential difference(沒有電位差為什麼還有會電流?🤔)
- 什麼是垃圾蒐集(GC)?為什麼要有GC呢?GC
- 為什麼使用了高匿代理IP還是會被限制?
- testWeb例子中,還沒有建立資料庫呢,怎麼回提示新增成功?Web資料庫
- 為什麼他們還在用 iPod 聽歌?
- GoCN為什麼沒有使用beego來搭建呢?Go
- 在頁面中的應該使用奇數還是偶數的字型?為什麼呢?
- hosts檔案格式說明,為什麼還有域名配置
- CSS 很容易,那為什麼大家還是把 CSS 寫的那麼爛呢?CSS
- 為什麼Python中沒有Switch/Case語句?Python
- 為什麼Java能夠持續的受到歡迎呢?原因有這些Java
- Twitter為什麼沒有當機?
- 什麼是響應式網頁?有什麼特點呢?網頁
- 反向代理是什麼?和正向代理有什麼區別呢?
- SQLSERVER為什麼不監聽1433埠SQLServer
- 伺服器端監聽器配置伺服器
- Python為什麼會這麼火呢?原因是什麼?Python
- 什麼是伺服器虛擬化呢伺服器
- Redis作為單執行緒 為什麼我用它還是出現了超賣呢?Redis執行緒
- AI,能為1.2億聽障老人做點什麼AI
- 雲伺服器,價格其實不便宜,但為什麼還要用呢伺服器
- SEO優化具體是什麼,SEO有什麼優劣呢?優化