web.xml
UI:繰り返しは私
<!-- JavaServer Faces -->
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-managed-beans.xml,/WEB-INF/faces-navigation.xml</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<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>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xi="http://www.w3.org/2001/XInclude" 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">
<validator>
<validator-id>com.test..view.validator.Regex</validator-id>
<validator-class>com.test..view.validator.regex.RegexValidator</validator-class>
</validator>
<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<message-bundle>com.test..view.resources.bundle.Messages</message-bundle>
</application>
</faces-config>
JSPファイル
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<html>
<head>
</head>
<body onload="alert(\"test\")">
It works <hr/>
<f:view>
<h:form>
<ui:repeat value="${buildVehicleBean.buildVehicleBO.allVehicles}" var="var1">
<h:outputText value="#{var1.modelLineName}"/><br/>
</ui:repeat>
</h:form>
</f:view>
</body>
</html>
私は、ブラウザでソースを表示すると、私は見
...
<ui:repeat value="[[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected]]" var="var1">
<br/>
</ui:repeat>
...
のためのデータをレンダリングしていません
ui:repeat内に 'br'タグ以外は表示されません。
私は非常にシンプルなようですが、明らかに私はどこかで何かが見つからない、それを見つけるのは難しいです。私は一定の値のような単純なものを使用している場合は、私は次の行に代わりに「$」の「#」を使用した場合、それは私がJSFとから来るに新しい
<ui:repeat value="${buildVehicleBean.buildVehicleBO.allVehicles}" var="var1">
エラーになります
<h:outputText value="#{12345}"/><br/>
<h:outputText value="#{buildVehicleBean.testDouble}"/><br/>
の作品JSP &ストラットの背景。
おかげBalusC!私はjstl forEachを使用しようとしましたが、forEachループ内でhを使用してBean属性にアクセスすることはできません:outputText - 私はやっている間違ったsomehting、h:outputTextもfaceletsだけで動作しますか? 私は試しました <%@ taglib接頭辞= "a4j" uri = "http://richfaces.org/a4j"%>
これは機能しました。私は何か働いて満足しています:)あなたの助けに感謝します。私が指摘したいことの1つは、このフォーラムでの多くの回答はあなたのフォームです、それは素晴らしいです! –
あなたは大歓迎です。 ''はあなたが '#{buildVehicleBean}'をビューであらかじめ参照している場合にのみ機能します。 '$ {...}'構文はマネージドBeanを自動作成しません。 http://stackoverflow.com/questions/7209377/what-is-the-difference-between-and-in-el-syntaxさらに、ここで新しくなったので、受け入れられた答えをマークすることを忘れないでください問題を解決するのに役立ちました(ほとんど)。 http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235も参照してください。 –
BalusC