Hello,

This is not entirely maverick specific but I am trying to find a
solution to this in maverick environment hence the question.

I am currently using jstl as a view technology but if this can
be achieved with velocity and not with jstl then I am quite
ready to switch. Prefer to find a quick jstl solution though.

I would like to make my views more modular and reuse
common components as much as possible. For example
if I iterate over some sort of collection I would rather
include a component that knows how to render this
object instead of having similar rendering code in so
many places.

So instead of this:
<c:forEach items="${model.projects}" var="p">
    <c:out value="${p.name}"/>, etc.
</c:forEach>

I would like to have something like this: (does not work like this though)
<c:forEach items="${model.projects}" var="p">
    <c:import url="/components/output-project.jsp">
      <c:param name="project" value="${p}"/>
    </c:import>
</c:forEach>

and something like this in output-project.jsp:
<c:out value="${param.project.name}"/>, etc.

This kind of approach works as far as I only pass simpe strings
but not with beans, etc. I need beans :)

So please tell me how do you do this?

best regards,
Taavi



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
[INVALID FOOTER]

Reply via email to