Home:ALL Converter>jsp jstl sql strange behaviour with as in mysql

jsp jstl sql strange behaviour with as in mysql

Ask Time:2011-02-15T08:03:52         Author:Pradyut Bhattacharya

Json Formatter

In mysql i m having a stored procedure which has a sql like:

select firstname as i_firstname , lastname as i_lastname from roleuser 
where user_id = uid ;

I m using a jstl code to get the values: -

<sql:query var="comm_codes" dataSource="jdbc/myDatasource">
    call sp_select_username(?);
    <sql:param>${user_id}</sql:param>
</sql:query>

<c:forEach var="rows" items="${comm_codes.rows}">
    ${rows.i_firstname} ${rows.i_lastname}
</c:forEach>

But this code does not return anything but when the replace the above code ${rows.i_firstname} with ${rows.firstname} i get the correct values.

Anything wrong with jstl, is this replicable or my fault here...

Question also posted here and here

thanks

Author:Pradyut Bhattacharya,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/4998749/jsp-jstl-sql-strange-behaviour-with-as-in-mysql
yy