0

I'm trying to get an element with a programmatically constructed id using EL in JSP. These ids follow the pattern table_1, table_2, table_3, etc. Earlier versions without the generated ids got them via ${table_a}, ${table_b}, etc. Now I'm trying to use ${table_${num}}, but that isn't working. Does anyone know how to do this?

Other things I've tried have been ${parent_element.children().get(0)} to sidestep having to use the id, but that doesn't seem to work either.

Clarification: I have a series of elements with ids table_1, table_2, table_3, etc. I need to get the elements themselves. You would normally do this with ${table_1}, ${table_2}, ${table_3}, but I'm trying to find a programmatic way to do it.

Brian Zhu
  • 1
  • 1
  • "${table}_${num}"? It's not completely clear what your requirements actually are. – Dave Newton Jun 28 '21 at 16:33
  • @DaveNewton I have a series of elements with ids table_1, table_2, table_3, etc. I need to get the elements themselves. You would normally do this with ${table_1}, ${table_2}, ${table_3}, but I'm trying to find a programmatic way to do it. – Brian Zhu Jun 28 '21 at 16:53
  • In what context are you trying to get them? Without any context it's difficult to understand what the issue is. – Dave Newton Jun 28 '21 at 17:03

0 Answers0