RF 3.3.3, IBM RAD 7.5 & Websphere 7
0rsa Mar 28, 2012 11:17 AMHello everybody,
Last 48h, I was hard trying to set up RichFaces on Rational Application Developer from IBM with a Websphere 7 server.
Today, I'm at this step :
- I created a dynamic web project and configure it to use JSF 1.2 (library for JSF is provided by IBM : jsf-ibm.jar)
- I followed this tutorial : http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/GettingStarted.html
- My jars list :
* commons-beanutils-1.8.0
* commons-collections-3.2
* commons-digester-1.8.1.jar
* commons-loggins-1.0.4
* customcomponent.jar
* customcomponent_annotations.jar
* icu4j_3_4_1.jar
* jhighlight-1.0.jar
* jsf-ibm.jar
* richfaces-api-3.3.3.Final.jar
* richfaces-impl-3.3.3.Final.jar
* richfaces-ui-3.3.3.Final.jar
- My files list :
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name> RichFaces</display-name> <context-param> <param-name>org.richfaces.LoadStyleStrategy</param-name> <param-value>ALL</param-value> </context-param> <context-param> <param-name>org.richfaces.LoadScriptStrategy</param-name> <param-value>ALL</param-value> </context-param> <context-param> <description> The location where state information is saved. Valid values are 'server' (typically saved in HttpSession) and 'client' (typically saved as a hidden field in the form. Default is server.</description> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value> </context-param> <context-param> <description> Comma-delimited list of context-relative resource paths under which the JSF implementation will look for application configuration resources, before loading a configuration resource named /WEB-INF/facesconfig.xml (if such a resource exists).</description> <param-name>javax.faces.CONFIG_FILES</param-name> <param-value>/WEB-INF/faces-config.xml</param-value> </context-param> <context-param> <description> The default suffix for extension-mapped resources that contain JSF components. Default is '.jsp'.</description> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.jsp</param-value> </context-param> <context-param> <description> Monitors Faces JSP files for modifications and synchronizes a running server with the changes without restarting the server. If this parameter is set to false or removed from the deployment descriptor, any changes made to Faces JSP files may not be seen by the server until it is restarted. This parameter is usually set to true while the Faces JSP files are being developed and debugged in order to improve the performance of the development environment.</description> <param-name>com.ibm.ws.jsf.JSP_UPDATE_CHECK</param-name> <param-value>true</param-value> </context-param> <context-param> <description> Load JSF runtime when the application server starts up. If this parameter is set to false or removed, JSF runtime will be loaded and initialized when the first JSF request is processed. This may disable custom JSF extensions, such as factories defined in the project.</description> <param-name>com.ibm.ws.jsf.LOAD_FACES_CONFIG_AT_STARTUP</param-name> <param-value>true</param-value> </context-param> <context-param> <description> If set to true disables use of MultipartFacesContext, allowing underlying implementations to be used. MultipartFacesContext is required when the FileUpload component is used, and can be disabled otherwise.</description> <param-name>com.ibm.faces.DISABLE_JWL_MULTIPART_CONTEXT</param-name> <param-value>false</param-value> </context-param> <context-param> <description> Value, in milliseconds, to be used for Expires header for resources served by the JavaScript Resource Servlet. Default is never (31536000000 milliseconds or 1 year).</description> <param-name>com.ibm.faces.RESOURCE_EXPIRE_MS</param-name> <param-value>31536000000</param-value> </context-param> <context-param> <description> Defines the strictness of the conversion when converting from a string to a date. The higher the value, the more exactly the value must conform to the format. If 0 (liberal), all 'literals' are ignored while parsing a value, mis-ordered components will be rearranged, any missing component is supplied using the current datetime, misspellings and incomplete spellings are allowed (to the extent that they can be evaluated), 'E' and other non-unique components are ignored. If 1 (strict), all 'literals' are ignored while parsing a value, any missing component is supplied using the current datetime, misspellings and incomplete spellings are allowed (to the extent that they can be evaluated), 'E' and other non-unique components are ignored. For example if the pattern is MMMM dd, yyyy a user can enter 'Feb/02/04' and it will be parsed as February 02, 2004. If 2 (very strict), an exact match is required except long month names can be 'shortened' to the minimum number of unique characters and 'E' and other non-unique components are ignored. Literals must match exactly. Default is 1.</description> <param-name>com.ibm.faces.DATETIME_ASSIST_STRICTNESS</param-name> <param-value>1</param-value> </context-param> <context-param> <description> Defines the strictness of the conversion when converting from a string to a number. The higher the value, the more exactly the value must conform to the pattern. For numbers, currently strictness levels of 0 and 1 are equivalent. If the strictness is 2, if number is signed, the sign must be provided (otherwise it's assumed positive). Default is 1.</description> <param-name>com.ibm.faces.NUMBER_ASSIST_STRICTNESS</param-name> <param-value>1</param-value> </context-param> <context-param> <description> Defines the path for resources such as JavaScript libraries and images. The value can be either: 1. An empty string. Context path of the current application will be used. 2. A path string. Example: /project13. A number. Specifies the number of nodes to use from the context path starting from the left. Example: With a value of 1 if the context path is /screen/faces/SSID110267549/RID1102676 the path will be evaluated as /screen Default is an empty string.</description> <param-name>com.ibm.faces.USE_UNENCODED_CONTEXT_PATH</param-name> <param-value></param-value> </context-param> <context-param> <description> Sets a custom url-pattern for the JavaScript Resource servlet. Should match servlet mapping setting for the JavaScript Resource servlet. If the default default mapping value '/.ibmjsfres/*' is modified, this context-param should also be modified. </description> <param-name>com.ibm.faces.JS_RESOURCE_SERVLET_URL_PATTERN</param-name> <param-value>/.ibmjsfres/*</param-value> </context-param> <context-param> <description> If set to true, forces JavaScript Resource Servlet to cache all resources on the server. This can be useful when client-side caching is turned off.</description> <param-name>com.ibm.faces.JS_RESOURCE_SERVLET_CACHE</param-name> <param-value>false</param-value> </context-param> <context-param> <description> Sets a custom charset mapping properties file similar to converter.properties in WAS.</description> <param-name>com.ibm.faces.ENCODING_MAPPING</param-name> <param-value>converter.properties</param-value> </context-param> <context-param> <description> If set to true, the entire JavaScript library, containing code for all components, will be included in the generated pages as one file. If set to false or removed, multiple smaller JavaScript files will be included, depending on the components used on the page.Default is false.</description> <param-name>com.ibm.faces.USE_HXCLIENT_FULL</param-name> <param-value>false</param-value> </context-param> <context-param> <description> Specifies maximum size for the request content processed by MultipartExternalContext. Can be used to prevent large files from being uploaded. Takes an integer value, in bytes. 0 or empty means there is no limit. Default is no limit. </description> <param-name>com.ibm.faces.MAX_REQUEST_CONTENT_SIZE</param-name> <param-value>0</param-value> </context-param> <!-- Plugging the "Blue Sky" skin into the project --> <context-param> <param-name>org.richfaces.SKIN</param-name> <param-value>blueSky</param-value> </context-param> <!-- Making the RichFaces skin spread to standard HTML controls --> <context-param> <param-name>org.richfaces.CONTROL_SKINNING</param-name> <param-value>enable</param-value> </context-param> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>JavaScript Resource Servlet</servlet-name> <servlet-class>com.ibm.faces.webapp.JSResourceServlet</servlet-class> <load-on-startup>-1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern> *.jsf</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern> /faces/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>JavaScript Resource Servlet</servlet-name> <url-pattern> /.ibmjsfres/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <!-- Defining and mapping the RichFaces filter --> <filter> <display-name>RichFaces Filter</display-name> <filter-name>richfaces</filter-name> <filter-class>org.ajax4jsf.Filter</filter-class> </filter> <filter-mapping> <filter-name>richfaces</filter-name> <servlet-name>Faces Servlet</servlet-name> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> </filter-mapping> </web-app>
faces-config.xml
<?xml version="1.0" encoding="UTF-8"?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd" version="1.2"> <application> <state-manager>com.ibm.faces.application.DevelopmentStateManager</state-manager> <el-resolver>COM.PWCINTERNAL.faces.richfaces.util.CustomComponentELResolver</el-resolver> </application> <factory> <faces-context-factory>com.ibm.faces.context.AjaxFacesContextFactory</faces-context-factory> <render-kit-factory>com.ibm.faces.renderkit.AjaxRenderKitFactory</render-kit-factory> </factory> <render-kit> <renderer> <component-family>javax.faces.Panel</component-family> <renderer-type>com.ibm.faces.Composite</renderer-type> <renderer-class>COM.PWCINTERNAL.faces.richfaces.util.CustomComponentRenderer</renderer-class> </renderer> </render-kit> <lifecycle> <phase-listener>com.ibm.faces.webapp.ValueResourcePhaseListener</phase-listener> </lifecycle> <managed-bean> <description>UsernName Bean</description> <managed-bean-name>User</managed-bean-name> <managed-bean-class>demo.User</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>name</property-name> <property-class>java.lang.String</property-class> <value/> </managed-property> </managed-bean> <managed-bean> <managed-bean-name>pc_Index</managed-bean-name> <managed-bean-class>pagecode.Index</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> </faces-config>
index.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%-- jsf:pagecode language="java" location="/src/pagecode/Index.java" --%><%-- /jsf:pagecode --%><%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <!-- RichFaces tag library declaration --> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <html> <head> <title>RichFaces Greeter</title> </head> <body> <f:view> <a4j:form> <rich:panel header="RichFaces Greeter" style="width: 315px"> <h:outputText value="Your name: " /> <h:inputText value="#{User.name}" > <f:validateLength minimum="1" maximum="30" /> </h:inputText> <a4j:commandButton value="Get greeting" reRender="greeting" /> <h:panelGroup id="greeting" > <h:outputText value="Hello, " rendered="#{not empty User.name}" /> <h:outputText value="#{User.name}" /> <h:outputText value="!" rendered="#{not empty User.name}" /> </h:panelGroup> </rich:panel> </a4j:form> </f:view> </body> </html>
User.java
package demo; public class User { private String name=""; public String getName() { return name; } public void setName(String name) { this.name = name; } }
When I deploy this project, I have this exception :
javax.servlet.ServletException: com.ibm.faces.renderkit.DefaultAjaxRenderer incompatible with org.ajax4jsf.renderkit.AjaxContainerRenderer
The jsf_ibm.jar is incompatible with richfaces.
I will try tomorroy to remove this class from jsf_ibm to get a new .jar without this object but I'm affraid to have strange behaviour. due to that...
Someone has already use these technologies together ? Richfaces is really good and I yould to use it!
Thanks in advance and sorry for my English, I did my best ahah