Jsf 动态字符串连接会导致长字符串

Jsf 动态字符串连接会导致长字符串,jsf,xpages,el,Jsf,Xpages,El,我目前在JSF方面面临着一个奇怪的问题,更确切地说,是被称为XPages的IBM方言 基本上,我想要的是在通过SSJS设置的数组上循环,因为EL3在Xpages中不是一个东西。到目前为止,情况很糟糕 我必须提供以下源代码: <xp:repeat rows="3" value="#{javascript: ['1','2','3']}" var="i"> <xp:div> <xp:te

我目前在JSF方面面临着一个奇怪的问题,更确切地说,是被称为XPages的IBM方言

基本上,我想要的是在通过SSJS设置的数组上循环,因为EL3在Xpages中不是一个东西。到目前为止,情况很糟糕

我必须提供以下源代码:

<xp:repeat rows="3" value="#{javascript: ['1','2','3']}" var="i">
    <xp:div>
        <xp:text styleClass="columnLabel" value="Bei Zahlung innerhalb von "></xp:text>
        <xp:text value=" Tagen, "/>
        <xp:text style="font-weight: bold" value="#{crmDoc['SKONTO_PZ'+i]}"/>
        <xp:text value=" % Skonto "/>           
        <div class="cleaner4px"></div>
    </xp:div>           
</xp:repeat>
部分堆栈跟踪:

com.sun.faces.el.impl.ElException: Ausnahmefehler beim Versuch, String "SKONTO_PZ" in Typ "java.lang.Long" zu konvertieren
com.sun.faces.el.impl.Coercions.coerceToPrimitiveNumber(Coercions.java:536)
com.sun.faces.el.impl.Coercions.applyArithmeticOperator(Coercions.java:832)
com.sun.faces.el.impl.ArithmeticOperator.apply(ArithmeticOperator.java:101)
com.sun.faces.el.impl.BinaryOperatorExpression.evaluate(BinaryOperatorExpression.java:189)
com.sun.faces.el.impl.ArraySuffix.evaluateIndex(ArraySuffix.java:141)
com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:170)
com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:163)
com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:257)
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:150)
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:134)
javax.faces.component.UIOutput.getValue(UIOutput.java:159)
com.ibm.xsp.util.FacesUtil.convertValue(FacesUtil.java:1121)

我就是不明白他到底为什么把两个字符串加上一个加号当作长字符串。

正如你帖子上的评论所暗示的,XPages EL并没有正确的语法:
+
是加法,然后我不认为有字符串连接操作符。最快的方法是切换到SSJS进行绑定


或者,如果你把
xp:div
做成
xp:panel
,你可以附加一些
xp:dataContexts
s并按照BalusC的建议去做。

正如你帖子上的评论所暗示的,XPages EL并没有正确的语法:
+
是加法,然后我不认为有一个字符串连接操作符。最快的方法是切换到SSJS进行绑定


或者,如果您将
xp:div
设置为
xp:panel
,则可以附加一些
xp:dataContexts
s并执行BalusC建议的操作。

+=
被视为错误语法。
.concat
也是如此。哎呀。必须是一些特定的XPages内容:(
+=
被视为一种错误的语法。
.concat
.Yikes也是如此。必须是一些特定的XPages内容:(最后,我使用了SSJS,尽管我尽量避免它。谢谢你的帮助!最后,我使用了SSJS,尽管我尽可能避免它。谢谢你的帮助!
com.sun.faces.el.impl.ElException: Ausnahmefehler beim Versuch, String "SKONTO_PZ" in Typ "java.lang.Long" zu konvertieren
com.sun.faces.el.impl.Coercions.coerceToPrimitiveNumber(Coercions.java:536)
com.sun.faces.el.impl.Coercions.applyArithmeticOperator(Coercions.java:832)
com.sun.faces.el.impl.ArithmeticOperator.apply(ArithmeticOperator.java:101)
com.sun.faces.el.impl.BinaryOperatorExpression.evaluate(BinaryOperatorExpression.java:189)
com.sun.faces.el.impl.ArraySuffix.evaluateIndex(ArraySuffix.java:141)
com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:170)
com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:163)
com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:257)
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:150)
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:134)
javax.faces.component.UIOutput.getValue(UIOutput.java:159)
com.ibm.xsp.util.FacesUtil.convertValue(FacesUtil.java:1121)