Hi Jakob,

I migrated my app from jsp/tiles to xhtml/facelets successfully in the last 2-3 days.
But your hint is unfortunately not working for me.

namespace in xhtml file for core tags is: xmlns:c="http://java.sun.com/jsp/jstl/core"; Is this the right one or do I have to use xmlns:c="http://java.sun.com/jstl/core"; (without jsp)?

jstl-1.2.jar is in the lib folder of my webApp.

<c:out does not print anything and the set value is also not accessible via EL in the getter of my bean.

My current code:
<html xmlns="http://www.w3.org/1999/xhtml";
      xmlns:ui="http://java.sun.com/jsf/facelets";
      xmlns:c="http://java.sun.com/jsp/jstl/core";>

<ui:composition template="templates/main.xhtml">
<ui:param name="activeTab" value="wb"/>

<c:set var="foo2" value="bla2" scope="request"/>
<c:set target="#{requestScope}" property="foo" value="fooValue" />

<ui:define name="navigation">
<ui:include src="/facelets/parts/navigation.xhtml"></ui:include>
</ui:define>

I try to access foo and foo2 in navigation.xhtml and in a getter called from navigation.xhtml.
Any Idea what's going wrong here ?

Greetz,
Michael

Am 20.07.2010 23:20, schrieb Jakob Korherr:
Hi Michael,

You can use<c:set>  from the JSTL to put the value into the request scope.
Then you can access it in the facelet and also later in the action method.

Namespace: xmlns:c="http://java.sun.com/jsp/jstl/core";

<c:set target="#{requestScope}" property="foo" value="fooValue" />

Regards,
Jakob

2010/7/20 Leonardo Uribe<[email protected]>

Hi

I checked in deep some days ago ui:param, and it only define the expression
when the view is build, but its context is not preserved on other phases.
FaceletContext extends from ELContext and override its VariableMapper and
FunctionMapper. So in practice, ui:param just add a variable on the
variable
mapper. but after ui:composition and ui:include ends its processing the
variable is just discarded, because the whole VariableMapper wrapper
created
by this two tags is removed too.

regards,

Leonardo Uribe

2010/7/20 Michael Heinen<[email protected]>

Is it possible to access the value of a facelets ui:param tag in phase
render response in a backing bean?
I tried to resolve #{activeTab} in MyController.getOnlick() without
success.

Sample:
1) Template
<ui:composition template="templates/main.xhtml">
<ui:param name="activeTab" value="blabla"/>

<ui:define name="navigation">
<ui:include src="/facelets/navigation.xhtml"></ui:include>
</ui:define>


2) navigation.xhtml
...
<t:commandLink onclick="#{MyController.onlick}"
...

I use myFaces 1.2.9 and facelets 1.1.15.

Thanks,
Michael





Reply via email to