• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP expression inside html:text attribute

 
J Mascis
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy -
I have some code such as:
<% for(int n=1;n <= 7;n++){ %>
<tr>
<td colspan="6">
<html:text property="person<%= n %>_name_first" size="22" value="" maxlength="64"/>
</td></tr>
<% } %>
Unfortunately, Struts ignores the scriptlet portion in the tag <%= n %>
Instead of the variable incrementing as I thought it would, the html output is <%= n %> and not the number I want to concatenate into the html output.
Anyone know of how I can get around this?? It works fine in standard ht markup but Struts converts the property into a straight up string. Ack, Please, help.....super powers.....failing........arch enemy.......winning
 
Eric Sexton
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dude! Where you been? (Did you get that ref?) I've been so bummed since you stopped doing Dinosaur Jr. The Fog is cool though. Keep on rockin'.
Now to get to your problem. I had a similar problem and this is how I got around it:

Does that help?
Mike Watt
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic