richFacesのバグがあったと思います。
switchType ='ajax'のtabPanelと2つの(空の)タブがある単純なページがあります。最初のタブには、値がBeanプロパティにバインドされているテキストエリアのみが含まれ、tabPanelは機能しません。タブを変更しようとしているときに次のログメッセージになります。
info [11:31:56.919]: Received 'begin' event from <div id=form:j_id2114509110_7e08d99f ...>
info [11:31:56.953]: Received 'beforedomupdate' event from <div id=form:j_id2114509110_7e08d99f ...>
info [11:31:56.957]: Element error
<error><error-name>javax.faces.component.UpdateModelException</error-name><error-message><![CDATA[org.apache.myfaces.view.facelets.el.ContextAwarePropertyNotWritableException: javax.el.PropertyNotWritableException: ResourceBundles are read-only]]></error-message></error>
error[11:31:56.959]: Received 'error@serverError' event from <div id=form:j_id2114509110_7e08d99f ...>
error[11:31:56.961]: [200] undefined: undefined
info [11:31:56.962]: Received 'complete' event from <div id=form:j_id2114509110_7e08d99f
値のバインドを削除すると、すべてが期待どおりに機能します。
また、入力ボックスによるテキストエリアの変更は正常に機能します
。
更新:switchType ='server'でサーバーエラーも発生します:
javax.el.PropertyNotWritableException: ResourceBundles are read-only
org.apache.myfaces.el.unified.resolver.ResourceBundleResolver.setValue(ResourceBundleResolver.java:69)
javax.el.CompositeELResolver.setValue(CompositeELResolver.java:68)
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:229)
org.jboss.el.parser.AstPropertySuffix.setValue(AstPropertySuffix.java:73)
org.jboss.el.parser.AstValue.setValue(AstValue.java:84)
org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.setValue(ContextAwareTagValueExpression.java:151)
javax.faces.component.UIInput.updateModel(UIInput.java:402)
javax.faces.component.UIInput.processUpdates(UIInput.java:324)
javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1332)
org.richfaces.component.AbstractTogglePanel.processUpdates(AbstractTogglePanel.java:302)
javax.faces.component.UIForm.processUpdates(UIForm.java:217)
javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1332)
javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1332)
javax.faces.component.UIViewRoot._processUpdatesDefault(UIViewRoot.java:1311)
javax.faces.component.UIViewRoot.access$600(UIViewRoot.java:74)
javax.faces.component.UIViewRoot$UpdateModelPhaseProcessor.process(UIViewRoot.java:1413)
javax.faces.component.UIViewRoot._process(UIViewRoot.java:1272)
javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:782)
org.apache.myfaces.lifecycle.UpdateModelValuesExecutor.execute(UpdateModelValuesExecutor.java:38)
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:392)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)
org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:271)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
動作するコードは次のとおりです。
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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" >
<h:head><title>Test</title></h:head>
<h:body>
<h:form id="form" >
<h1>Test</h1>
<rich:tabPanel switchType="ajax" >
<rich:tab name="tab1" header="tab1">
<h:inputTextarea value="#{testBean.text}" />
</rich:tab>
<rich:tab name="tab2" header="tab2">
Tab2
</rich:tab>
</rich:tabPanel>
</h:form>
<a4j:log style="text-align:left;height:auto;" />
</h:body>
</html>
そしてここに私の環境:Tomcat 6.0.18、Java 1.6.0_25、Win6.1ビルド7601
および依存関係:
<dependency>
<groupId>org.apache.myfaces.tomahawk</groupId>
<artifactId>tomahawk20</artifactId>
<version>1.1.10</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<artifactId>myfaces-impl</artifactId>
<groupId>org.apache.myfaces.core</groupId>
<version>2.0.9</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-impl</artifactId>
<version>4.2.2.Final</version>
</dependency>
<dependency>
<groupId>org.richfaces.ui</groupId>
<artifactId>richfaces-components-ui</artifactId>
<version>4.2.2.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-el</artifactId>
<version>2.0.0.GA</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<artifactId>javax.el</artifactId>
<groupId>el-api</groupId>
</exclusion>
</exclusions>
</dependency>
誰かがそのような問題に遭遇しましたか、回避策はありますか?