25
25
26
26
import javax .servlet .RequestDispatcher ;
27
27
import javax .servlet .ServletConfig ;
28
+ import javax .servlet .ServletContext ;
28
29
import javax .servlet .ServletException ;
29
30
import javax .servlet .http .HttpServlet ;
30
31
import javax .servlet .http .HttpServletRequest ;
36
37
import org .sakaiproject .tool .cover .SessionManager ;
37
38
import org .sakaiproject .tool .api .Tool ;
38
39
import org .sakaiproject .util .Web ;
40
+ import org .sakaiproject .component .cover .ComponentManager ;
41
+ import org .sakaiproject .component .api .ServerConfigurationService ;
39
42
40
43
/**
41
44
* <p>
@@ -277,7 +280,15 @@ public String getServletInfo()
277
280
public void init (ServletConfig config ) throws ServletException
278
281
{
279
282
super .init (config );
280
-
283
+ ServerConfigurationService scs = ComponentManager .get (ServerConfigurationService .class );
284
+ ServletContext context = config .getServletContext ();
285
+ String customJsfState = scs .getString ("jsf.state_saving_method." +config .getServletName (), null );
286
+ String defaultJsfState = scs .getString ("jsf.state_saving_method" , "client" );
287
+ if (customJsfState != null ) {
288
+ context .setInitParameter ("javax.faces.STATE_SAVING_METHOD" , customJsfState );
289
+ } else if (defaultJsfState != null ) {
290
+ context .setInitParameter ("javax.faces.STATE_SAVING_METHOD" , defaultJsfState );
291
+ }
281
292
m_default = config .getInitParameter ("default" );
282
293
m_path = config .getInitParameter ("path" );
283
294
m_defaultToLastView = "true" .equals (config .getInitParameter ("default.last.view" ));
@@ -288,7 +299,7 @@ public void init(ServletConfig config) throws ServletException
288
299
m_path = m_path .substring (0 , m_path .length () - 1 );
289
300
}
290
301
291
- M_log .info ("init: default: " + m_default + " path: " + m_path );
302
+ M_log .info ("init: " + config . getServletName ()+ "[" + context . getInitParameter ( "javax.faces.STATE_SAVING_METHOD" )+ "]" + " default: " + m_default + " path: " + m_path );
292
303
}
293
304
294
305
/**
0 commit comments