Hi,

We porting/upgrading a relatively simple survey tool over to struts2 from an
old php version.

The tool manages questions which can one of a fixed type (radio, drop,
checkbox, text) and then persists responses to DB.
Where I need some advice is how to implement the struts 2 display mechanism.

I figure there are two options:

1. Write a custom tag which takes the question as an attribute. Something
like <s:question value=²%{question}² />

2. I could have a small jsp fragment that I would include to render the
appropriate html.

I figured I¹d do something like :

<s:iterator value=²questions² id=²question²>
<s:push value=²%{question}²>
    <s:include value=²pagefragment.jspf²/>
</s:push>
</s:iterator>

And pagefragment.jspf would have some logic and use the appropriate form
tags to render the HTML.

I was looking for some input into what people think.


Z.

Reply via email to