Probléme avec le scope request
Salut,
J'utilise un scope request pour le managed bean. Je voudrais savoir si c'est possible d'éviter de crée à chaque fois un nouveau bean lors de chaque rafraichissement de vue.
En effet, avec ma a configuration actuelle, lors de chaque rafraichissement de ma vue, on utilisant par exemple un F5, il y a création d'un nouveau managed bean. Or mon constructeur fait beaucoup choses et crée beaucoup de structures. Ce qui me cause une perte énorme en temps d'exécution.
Voila ma configuration
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <managed-bean>
<description>
Backing bean for order book monitoring
</description>
<managed-bean-name>orderBook</managed-bean-name>
<managed-bean-class>
com.ulnet.memberarea.web.OrderBook.OrderBookBean
</managed-bean-class>
<managed-bean-scope>
request
</managed-bean-scope>
<managed-property>
<property-name>renderManager</property-name>
<value>#{rmanager}</value>
</managed-property>
</managed-bean> |
et voila mon web.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
| <?xml version="1.0"?>
<!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>
<context-param>
<param-name>com.icesoft.faces.debugDOMUpdate</param-name>
<param-value>false</param-value>
</context-param>
<!-- This tells JSF to assume a prefix of jspx, which the Facelet's rendered can interpret.
Facelets can use many other parameters depending on your application -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jspx</param-value>
</context-param>
<!-- javax.faces.STATE_SAVING_METHOD identifies where the state of the
view is stored between requests. By default state is saved in the
servlet session. -->
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
<description>
State saving method: "client" or "server" (= default)
See JSF Specification 2.5.2
</description>
</context-param>
<!--
To allow multiple windows for a single application, concurrent DOM
views must be enabled.
-->
<context-param>
<param-name>com.icesoft.faces.concurrentDOMViews</param-name>
<param-value>true</param-value>
</context-param>
<!--
To cause request scope to last only for the duration of a single user event, "standard request scope" must be enabled. This is set through the ICEfaces context parameter:
com.icesoft.faces.standardRequestScope
-->
<!--
<context-param>
<param-name>com.icesoft.faces.standardRequestScope</param-name>
<param-value>true</param-value>
</context-param>
-->
<!--
Synchronous or asynchronous updates can be turned off/on application-wide
using the ICEfaces context parameter
-->
<context-param>
<param-name>com.icesoft.faces.synchronousUpdate</param-name>
<param-value>false</param-value>
</context-param>
<listener>
<listener-class>com.icesoft.faces.util.event.servlet.ContextEventRepeater</listener-class>
</listener>
<!-- Added because a bug appear with Tomcat 5.5.20 -->
<listener>
<listener-class>
com.sun.faces.config.ConfigureListener
</listener-class>
</listener>
<!-- Faces Servlet
The Faces Servlet (javax.faces.webapp.FacesServlet) is the standard JSF servlet.
This is the servlet that manages the request-processing JSF lifecycle.
-->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!--
The PersistentFacesServlet is our custom ICEfaces JSF Servlet (in other words,
our custom Faces Servlet that does the same request processing JSF lifecycle)
-->
<servlet>
<servlet-name>Persistent Faces Servlet</servlet-name>
<!-- <servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class> -->
<servlet-class>
com.ulnet.memberarea.web.Connection.MemberAreaFacesServlet
</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<!--
For Ajax requests !!!
-->
<servlet>
<servlet-name>Blocking Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<!-- extension mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.iface</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Blocking Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>700</session-timeout>
</session-config>
<!-- Welcome files -->
<welcome-file-list>
<welcome-file>index.jsf</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app> |
Note : 'utilise Icefaces dans la couche web.
Toute proposition sera la bienvenue.
Merci