Guessing you are trying to create dynamic names for the text fields. If you 
have dynamic names how are you going to get the values into your action? You 
could probably have an array of text fields
where the names of text fields are like mytext[columnName1], 
mytext[columnName2]  etc.

You can then use a map in the action to collect the values from the jsp. In the 
below example you would use a map named mycolumns.

<c:forEach var="column" items="${columnList}">
    <s:textfield name="mycolumns['%{#attr.column}']" />
</c:forEach>

I think Struts2 tags don't allow EL so you have to use OGNL expression to 
create dynamic names.

On 2/18/20 7:09 AM, Lukasz Lenart wrote:
> wt., 18 lut 2020 o 05:22 M Huzaifah <mhuzaifah.i...@gmail.com> napisał(a):
>> I've looking for solution how to create struts2 tag could generate
>> dynamically. This is my code:
>>
>> <c:forEach items=${columnList} var="column">
>>      <s:textfield name:${column.columnName}/>
>> </:c>
> You shouldn't mix Struts and non-Struts tags, this is a bad idea. Why
> don't you use <s:iterator/> here?
> https://struts.apache.org/tag-developers/iterator-tag.html
>
> And I'm not sure what do you want achieve with this strange syntax
> "name:${column.columnName}"?
>
>
> Regards

Reply via email to