On Wed, 30 Oct 2002, Lorenzo Sicilia wrote:

> The Sql tag is very usefull but I read in "JSTL in ACTION" that it don't 
> support pooling connection. Is true?

The <sql:setDataSource> tag, when used to create a DataSource, doesn't
support pooling (unless you somehow have a pooling JDBC driver, which
isn't the way things are supposed to work).  However, the SQL tags can
support pooling by using, rather than creating, a DataSource.

> 2-
> I need read a recorset JSTL with JSP script because the JSTL tag put 
> "\n" each time I close a tag. I need an output without "\n" but I like 
> JSTL recorset.
> 
> <c:set var="language_set" value="it" />2
> <sql:query var="elenco" >
> SELECT        ID_news,data,
>               titolo_<c:out value="${language_set}" /> as titolo,
>               abstract_<c:out value="${language_set}" /> as abstract,
>               testo_<c:out value="${language_set}" /> as testo,
>               data
> FROM tb_news
> </sql:query>
> <!--
> The follow script don't work. Do you now where path recorset variables are?
> -->
> <%
> out.print(elenco);
> %>

Note first that it's better to be using <sql:param> and the '?'
placeholder syntax for SQL, rather than using <c:out> inside
<sql:query>.  But that doesn't address your problem.

I'm actually not sure what problem you *are* having:  <c:out> shouldn't
print newlines at the end of its output.  However, when you follow <c:out>
with a newline (outside the tag), then *that* newline is printed.  But
you'd have the same problem with scriptlets.

Anyway, to answer your specific question, you'd write

 <%= pageContext.findAttribute("elenco") %>

This is better than out.print(), and it retrieves the scoped attribute via
the PageContext object, which is necessary, for it's not a scripting
variable (just a scoped attribute).

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@;jakarta.apache.org>

Reply via email to