mirror of
https://github.com/apache/struts.git
synced 2026-08-06 07:06:58 +00:00
Fixing jsf setup interceptor to not complain so loudly if jsf isn't present, fixed freemarker
test to properly extend StrutsTestCase git-svn-id: https://svn.apache.org/repos/asf/struts/action2/trunk@408140 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -57,8 +57,17 @@ public class FacesSetupInterceptor extends FacesSupport implements Interceptor {
|
||||
* Initializes the lifecycle and factories
|
||||
*/
|
||||
public void init() {
|
||||
facesContextFactory = (FacesContextFactory) FactoryFinder
|
||||
try {
|
||||
facesContextFactory = (FacesContextFactory) FactoryFinder
|
||||
.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
|
||||
} catch (Exception ex) {
|
||||
log.debug("Unable to initialize faces", ex);
|
||||
}
|
||||
|
||||
if (facesContextFactory == null) {
|
||||
log.info("Unable to initialize jsf interceptors probably due missing JSF framework initialization");
|
||||
return;
|
||||
}
|
||||
// Javadoc says: Lifecycle instance is shared across multiple
|
||||
// simultaneous requests, it must be implemented in a thread-safe
|
||||
// manner.
|
||||
|
||||
+2
-3
@@ -18,16 +18,15 @@
|
||||
package org.apache.struts.action2.views.freemarker;
|
||||
|
||||
import org.apache.struts.action2.StrutsConstants;
|
||||
import org.apache.struts.action2.StrutsTestCase;
|
||||
import org.apache.struts.action2.config.Configuration;
|
||||
import org.apache.struts.action2.views.jsp.StrutsMockServletContext;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* Test case for FreemarkerManager
|
||||
*
|
||||
*/
|
||||
public class FreemarkerManagerTest extends TestCase {
|
||||
public class FreemarkerManagerTest extends StrutsTestCase {
|
||||
|
||||
public void testIfStrutsEncodingIsSetProperty() throws Exception {
|
||||
Configuration.set(StrutsConstants.STRUTS_I18N_ENCODING, "UTF-8");
|
||||
|
||||
Reference in New Issue
Block a user