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>

[1657 byte] By [jan@f10a] at [2007-11-27 7:09:26]
# 1

This is definitely supported in Apache Trinidad or Oracles ADF look at documentaion associated with Regions. I implemented this, in insurance policy, where we have each risk as a separate region that can be selectively included on a page.

I know of no way of doing this in reference implemenation

smurray_eriea at 2007-7-12 19:00:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks,we haven't decided on a specific jsf implementation yet. If the standard already provides a solution, I would like to use that. It's not very encouring to use JSF if this basic funccitonality is not covered in a 1.2 spec.CheersJan
jan@f10a at 2007-7-12 19:00:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
To the best of my knowledge JSF does not support this type of templating using the standard ViewHandler. However, facelets does support it rather nicely.
RaymondDeCampoa at 2007-7-12 19:00:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...