rich faces 4 does not work
maxim_rong Apr 5, 2011 3:37 AMi have user rich faces 4 to my project, but i find it does not work. and i don't know why?
my project user jsf2 + mybatis + weblogic
IDE is myEclipse8.5
i import jar is:
richfaces-components-ui-4.0.0 FInal.jar
richfaces-components-api-4.0.0 FInal.jar
richfaces-core-impl-4.0.0 FInal.jar
richfaces-core-api-4.0.0.Final.jar
sac-1.3.jar
cssparser-0.9.5.jar
guava-r08.jar
The following is my page:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:t="http://myfaces.apache.org/tomahawk">
<head>
<title>MyTest.xhtml</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script src="js/jquery-1.5.1.min.js"></script>
<script>
<!--
window.onload = function() {
// test();
}
//-->
</script>
</head>
<h:body>
<h:form>
<table align="center">
<tr>
<td>用户名:</td>
<td><t:inputText forceId="true" id="emailPre" value="#{userInfo.emailPre}" >
<a4j:ajax event="keyup" render="outtext" />
</t:inputText> @
<t:selectOneMenu id="menu1" value="#{userInfo.emailSuf}">
<t:selectItems value="#{userInfo.emailSufList}" var="suf" itemLabel="#{suf}" itemValue="#{suf}" />
</t:selectOneMenu>
<h:outputText id="outtext" value="#{userInfo.emailPre}" />
</td>
</tr>
<tr>
<td>密码: </td>
<td><t:inputText forceId="true" value="#{userInfo.passWord}"/> </td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</h:form>
</h:body>
</html>
{code}
i hava change "emailPre"(id), but the outputText id="outtext" show nothing!
The following is my web.xml:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.jsf</welcome-file>
</welcome-file-list>
</web-app>
{code}
face-config.xml
{code: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_2_0.xsd"
version="2.0">
<managed-bean>
<managed-bean-name>javaTest</managed-bean-name>
<managed-bean-class>agile.web.test.JavaTest</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>userInfo</managed-bean-name>
<managed-bean-class>com.agile.sys.UserInfo</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
{code}