-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bryan Basham schrieb:
> By default the JSTL <c:set> tag stores the attribute in the PAGE scope.
> However, JSF does not know about the PAGE scope. If you really need
> to use <c:set> then specify: scope='REQUEST'.
>
> -Bryan
Thank you very much! This indeed works. Is there a 'better' or another
approach which I could take? A concrete use-case would be that I want to
iterate over a collection from a bean (not a managed bean) like that:
- ---
<jsp:useBean id="bean" class="de.fhbswf.emaex.web.TestBean"
scope="request"/>
<c:forEach var="testValue" items="${bean.test}" >
<h:outputText value="${testValue.value}" />
</c:forEach>
- ---
In this case it is not possible without saving the value in a variable
created by c:set.
Another use-case I have is to manipulate the id's of h:inputText-tags so
that the id in the message which a validator produces can be localized
or simply replaced:
- ---
<f:loadBundle
basename="properties.localization.ui.suppliercreateproduct"
var="createproductBundle"/>
<h:inputText id="${createproductBundle.articlenrID}"
required="true"
value="#{ProductCreator.articlenumber}">
<h:message for="${createproductBundle.articlenrID}"
styleClass="error" />
- ---
So again: could these cases be handled in a better way?
Christian
> Christian Nolte wrote:
>> Hi!
>>
>> I have the following problem: I have to evaluate values which have been
>> set using JSTL-Core-tags like set or forEach using JSF-Tags like
>> outputText to output them. The situation is like this:
>>
>> -- test.jsp:
>> <!-- ... -->
>>
>> <jsp:useBean id="bean" class="de.fhbswf.emaex.web.TestBean" />
>>
>> <c:set var="test" value="${bean.test}" />
>> Set: ${test}
>>
>> Output: <h:outputText value="#{test}"/>
>>
>> <!-- ... -->
>> --
>>
>> I understand that JSF has no rtexpression evaluation and I know that
>> this is for security reasons but I would like to know how I can use
>> these two taglibs together.
>>
>> Best regards
>> Christian
>>
>>
>>
>
- --
For more than 4 generations the IT Professionals were the
guardians of quality and stability in software. Before the
dark times. Before Microsoft...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFGshL8CNjA0nfhW7wRAtT9AKDDRBdMm1gamN6tqgMycmfwLeFEPQCfXao+
vKTumz51p2FkVpedwkL+i+s=
=qqKr
-----END PGP SIGNATURE-----