So, I've been using struts for a while... even back when Tiles used to
be called "Components". :-)
I'm pretty impressed with how far things have come and how useful the
framework is...
Anyway, I'm new to using <nested> tags and am trying to use them in
combination with Tiles.
The goal I have is to iterate over a bunch of questions, each question
which has its own layout. For now, ignore how the layout switch is
handled - I'm more concerned about passing nested context between tiles
if it's possible. (I've actually accomplished the switch via a
logic:equals sort of hack for the time being rather than pre-loading any
data in a tiles controller. Why this works with a tiles:insert, I'm not
sure since one would think it would have flush-from-within-a custom-tile
issues as well.)
First pass (without swapped layout):
<nested:iterate property="questions" scope="request">
<nested:nest property="question">
<nested:write property="questionText" /><br />
<nested:hidden property="questionId" /><br />
<!-- insert answers here later -->
</nested:nest>
</nested:iterate>
What I would like to do in concept:
*** questions.jsp
<nested:iterate property="questions" scope="request">
<tiles:insert attribute="questionLayout" flush="false"/>
</nested:iterate>
*** questionLayout.jsp
<nested:nest property="question">
<nested:write property="questionText" /><br />
<nested:hidden property="questionId" /><br />
<!-- insert answers here later -->
</nested:nest>
Problems I've had:
1. Tiles & flush = "false"
I'm using JBoss 3.2.0RC1 w/Jetty - the Tiles flush tag doesn't seem
to work or Jetty mishandles it. I know we're fighting against the
JSP 1.1 spec.
Symptom: The flushed tile HTML appears first, the containing JSP HTML
after
2. Losing nested context
Once I do the tiles:insert, I lose the nested context. I need to be
able
to generate the problem index for each question in the form. This
should
look something like:
questions[0].question.questionId="nnnn"
questions[1].question.questionId="mmmm"
Thoughts:
1. When will Struts move to support JSP 1.2? It's been around for a
long time now.
In fact, isn't JSP 1.3 out there as well?
2. Is there any good documentation on Tiles and Nested in combination?
So far, I've been to a lot of the struts resources without much luck.
3. I love the concept of Tiles controllers. These are fantastic for
moving a
Tile around a webapp solely by referencing it via the JSP/tiles defs.
Is
there anyway to leverage this concept in relation to my desired
objectives?
Thanks loads - any tips or even possible approaches would be fantastic.
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]