Composing a view with JSPs passing parameters (JSF 1.2)
hi,
I want to include a JSP in another twice. The two includes should work on different backing bean instances. (Of cource the include contains JSF components)
Business case: An insurance policy has one reference to a person in the role insured person and another in the role policy owner. I would like to use the same JSP to present the two persons.
Here is the question
- Is it possible to pass parameters to an included JSP?
- I tried it out (see code below) and it did not work using the reference implementaion 1_02-b08. Is there a mistake in the code or is this not supported? I checked the spec, but chapter 9.2.9 does not provide any information about the topic.
- If this is not supported, how is this solved using standard jsp/jsf?
(I know I can use facelets, but I expect a a solution in the standard)
Kind regards
Jan
view.jsp:
<f:view>
<!-- the'policy' is a managed bean with session scope -->
<jsp:include page="person.jsp>
<jsp:param name="person" value="#{policy.insuredPerson}" />
</jsp:include>
<jsp:include page="person.jsp>
<jsp:param name="person" value="#{policy.policyOwner}" />
</jsp:include>
</f:view>
person.jsp (example displays the person's name)
<h:outputText value="#{param.person.name}"></h:outputText>

