Bug 21608 - getColumn tag not compatible with JSTL iterator forEach for position parameter
Summary: getColumn tag not compatible with JSTL iterator forEach for position parameter
Status: RESOLVED INVALID
Alias: None
Product: Taglibs
Classification: Unclassified
Component: DBTags Taglib (show other bugs)
Version: 1.0B1
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-15 14:27 UTC by Mitch Winkle
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mitch Winkle 2003-07-15 14:27:36 UTC
Not sure if this is an issue or is supposed to work this way, but here goes.

Working with DBTags 1.0B1 on Tomcat 4.1.18.

When processing each row of a result set, I attempted to use the JSTL c:forEach
iterator with getColumn tag in order to iterate over a number of columns which
all were output the same way.  For example:

<tr>
<c:forEach var="x" begin="3" end="9">
<td>
<sql:getColumn position="${x}"/>
</td>
</c:forEach>
</tr>

This causes a situation where the page will not compile with a Java error of
"NumberFormatException ${x}"

Must the position attribute be a literal???  Obviously, this is not a
show-stopper, but makes for a lot of extra typing :-)

Mitch
Comment 1 Mitch Winkle 2003-07-18 22:00:52 UTC
BTW...the sql:x tags are taglibs-dbtags....MW
Comment 2 Felipe Leme 2003-07-31 03:55:40 UTC
I took a look on the code, and looks like it doesn't support EL:

 public void setPosition(String strPosition) throws JspTagException
  {
    try {
      _position = Integer.parseInt (strPosition);
    } catch (NumberFormatException ex) {
      throw new JspTagException ("The 'position' attribute must be an int: " +
ex.getMessage());
    }
  }
Comment 3 Felipe Leme 2003-07-31 03:57:08 UTC
OOPS, marked the bug as invalid (I think it is invalid, but I didn't think I had
permission to change that)
Comment 4 Mitch Winkle 2003-12-04 15:10:12 UTC
BTW...the lists suggest that this is a simple fix that someone has already
figured out.  Just hasn't been patched in the official releases for some reason.

I'll dig up the thread and put it here.
Comment 5 Mitch Winkle 2003-12-04 15:16:42 UTC
http://marc.theaimsgroup.com/?l=axis-user&m=106241914329425&w=2

is the list thread.  It is long and has plenty of input including a "fix".
Comment 6 Mitch Winkle 2003-12-04 15:28:15 UTC
Sorry, put text in the wrong bug entry...last two entries are not related. 
Marking invalid as it is indicated that EL is not supported.

Mitch