How to configure Apache MyFaces CODI with JBoss AS 7 and Mojarra 2.1?

756 Views Asked by At

I have Apache CODI for JSF 2 installed and working. I would like to change "isUrlParameterSupported" to be false, instead of the default true.

Switching my projects to OpenWebBeans is not possible at this time. I am not currently using MyFaces itself, just the CODI extension.

I am using the following jars:

myfaces-extcdi-core-api-1.0.5.jar
myfaces-extcdi-core-impl-1.0.5.jar
myfaces-extcdi-jsf20-module-api-1.0.5.jar
myfaces-extcdi-jsf20-module-impl-1.0.5.jar
myfaces-extcdi-message-module-api-1.0.5.jar
myfaces-extcdi-message-module-impl-1.0.5.jar

Ideally I would like to be able to use a simple text properties file.

1

There are 1 best solutions below

0
On

I found one method to change this property. Using this page as a guide:

http://cwiki.apache.org/EXTCDI/jsf-config-and-spi.html

I created the following class:

import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.config.WindowContextConfig;

@ApplicationScoped
@Specializes
public class CustomWindowContextConfig extends WindowContextConfig {

@Override
public boolean isUrlParameterSupported() {
    return false;
}
}

And vitally, I created an empty file named "beans.xml" the WEB-INF folder of my project. We had not been using CDI previously, so did not have this file in place yet.