带有richfaces 3的jsf,ajax4jsf不工作
我将JSF与richfaces3.3.3一起使用,其他JSF功能也可以使用,但我不知道为什么ajax不能使用 下面是ajax命令按钮,它不会给出错误,也不会生成错误带有richfaces 3的jsf,ajax4jsf不工作,jsf,richfaces,ajax4jsf,Jsf,Richfaces,Ajax4jsf,我将JSF与richfaces3.3.3一起使用,其他JSF功能也可以使用,但我不知道为什么ajax不能使用 下面是ajax命令按钮,它不会给出错误,也不会生成错误 <a4j:commandButton value="Say Hello" render="out"/> 可能是由于ajax4sf过滤器,但我有过滤器,为什么它不能捕获jsf请求 我是否需要myfaces来使用ajax4jsf 下面是我的web.xml和其他代码 <?xml version="1.0" en
<a4j:commandButton value="Say Hello" render="out"/>
可能是由于ajax4sf过滤器,但我有过滤器,为什么它不能捕获jsf请求
我是否需要myfaces来使用ajax4jsf
下面是我的web.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">
<description>Sample application</description>
<display-name>richfaces-start</display-name>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>2</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<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>*.jsf</url-pattern>
</servlet-mapping>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>
------------
start.xhtml
------------
<!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:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<head><title>RichFaces</title></head>
<body>
<rich:panel header="RichFaces">
<h:outputText value="Hello, looks like it's working" />
</rich:panel>
<h:form>
<h:panelGrid columns="3">
<h:outputText value="Name:" />
<h:inputText value="#{userBean.name}" />
<a4j:commandButton value="Say Hello" render="out"/>
</h:panelGrid>
</h:form>
<br />
<a4j:outputPanel id="out">
<h:outputText value="Hello #{userBean.name} !"
rendered="#{not empty userBean.name}" styleClass="outhello" />
</a4j:outputPanel>
</body>
</html>
在Richfaces 3.3.3中,a4j:commanButton没有属性render。取而代之的是,它有了重播。改变你的属性,它就会工作