You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Shawn Bayern <ba...@essentially.net> on 2002/08/03 00:09:16 UTC

JSTL in Action: first few chapters

In case anyone's interested, I just found out that the first four chapters
of "JSTL in Action" have been posted for free at

  http://www.codercoop.com

These early chapters are ideal for novice page authors; if you're a
developer, you might want to forward them to page authors you work with.
The chapters cover the principles of web development, the JSTL expression
language, and the JSTL conditional tags.

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


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: using datasource

Posted by anand <an...@columbus.rr.com>.
Yes.


-----Original Message-----
From: Hans Bergsten [mailto:hans@gefionsoftware.com] 
Sent: Sunday, August 04, 2002 3:53 PM
To: Tag Libraries Users List
Subject: Re: using datasource

The Kelley's wrote:
> Well I bought the book and the URL that was supposed to have a
tutorial on
> how to install JSTL in Tomcat is forbidden.
> Anyone have a clue?

Just to make sure I'm not mistaken: you're talking about Shawn's book,
right? Mine is not released yet. If you refer to something I've written,
please let me know so I can correct the problem.

Hans

> -----Original Message-----
> From: Hans Bergsten [mailto:hans@gefionsoftware.com]
> Sent: Sunday, August 04, 2002 3:01 PM
> To: Tag Libraries Users List
> Subject: Re: using datasource
> 
> anand wrote:
> 
>>Well what I mean was how you tell the JSTL to use what datasource.
>>I have more than one datasource defined in config.xml that are
>>Connection pooled.  In web xml
>>
>>Can I just say like this
>>
>><context-param>
>>  <param-name>
>>       javax.servlet.jsp.jstl.sql.dataSource
>> </param-name>
>> <paramvalue>
>>       myDataSource
>> </param-value>
>></context-param>
> 
> 
> If that's the name it's been registered with in the JNDI
java:comp/env/
> context, yes. The J2EE spec recommends that you use a name that starts
> with "jdbc", however, so "jdbc/myDataSource" would be the full name if
> you follow the recommended conventions. The hard rule is that you must
> use the same name as you declare with the <res-ref-name> element in
the
> web.xml file for the application.
> 
> How to tell the container how to create and configure a data source
with
> this name varies between containers. For Tomcat 4, it's done with the
> <ResourceParams> element in the conf/server.xml file. See the Tomcat
> docs for details:
> 
> 
>
<http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.ht
ml>
> 
> Hans
> <plug>I cover this in great detail in JavaServer Pages, Second Edition
> (O'Reilly), to be released in August</plug>
> --
> Hans Bergsten           hans@gefionsoftware.com
> Gefion Software         http://www.gefionsoftware.com
> JavaServer Pages        http://TheJSPBook.com
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
> 


-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
JavaServer Pages	http://TheJSPBook.com


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: using datasource

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
The Kelley's wrote:
> Well I bought the book and the URL that was supposed to have a tutorial on
> how to install JSTL in Tomcat is forbidden.
> Anyone have a clue?

Just to make sure I'm not mistaken: you're talking about Shawn's book,
right? Mine is not released yet. If you refer to something I've written,
please let me know so I can correct the problem.

Hans

> -----Original Message-----
> From: Hans Bergsten [mailto:hans@gefionsoftware.com]
> Sent: Sunday, August 04, 2002 3:01 PM
> To: Tag Libraries Users List
> Subject: Re: using datasource
> 
> anand wrote:
> 
>>Well what I mean was how you tell the JSTL to use what datasource.
>>I have more than one datasource defined in config.xml that are
>>Connection pooled.  In web xml
>>
>>Can I just say like this
>>
>><context-param>
>>  <param-name>
>>       javax.servlet.jsp.jstl.sql.dataSource
>> </param-name>
>> <paramvalue>
>>       myDataSource
>> </param-value>
>></context-param>
> 
> 
> If that's the name it's been registered with in the JNDI java:comp/env/
> context, yes. The J2EE spec recommends that you use a name that starts
> with "jdbc", however, so "jdbc/myDataSource" would be the full name if
> you follow the recommended conventions. The hard rule is that you must
> use the same name as you declare with the <res-ref-name> element in the
> web.xml file for the application.
> 
> How to tell the container how to create and configure a data source with
> this name varies between containers. For Tomcat 4, it's done with the
> <ResourceParams> element in the conf/server.xml file. See the Tomcat
> docs for details:
> 
> 
> <http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html>
> 
> Hans
> <plug>I cover this in great detail in JavaServer Pages, Second Edition
> (O'Reilly), to be released in August</plug>
> --
> Hans Bergsten           hans@gefionsoftware.com
> Gefion Software         http://www.gefionsoftware.com
> JavaServer Pages        http://TheJSPBook.com
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
JavaServer Pages	http://TheJSPBook.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: using datasource

Posted by The Kelley's <ti...@mindspring.com>.
Yep I was talking about shawns book
There was  an url http://www.manning.com/bayern/tomcat that was suppose to
have a tutorial for setting up JSTL in Tomcat

Tim


-----Original Message-----
From: Shawn Bayern [mailto:bayern@essentially.net]
Sent: Sunday, August 04, 2002 3:50 PM
To: Tag Libraries Users List; timdona@mindspring.com
Subject: RE: using datasource

If you mean the "JSTL in Action" book, that link will be up tomorrow; it
was timed for the printed edition, not the ebook.  If you want to get up
and running today, we have a little bundle of JSTL + Tomcat + the book's
examples at

  http://www.manning.com/getpage.html?project=bayern&filename=source.html

This lets you avoid having to set up Tomcat with JSTL, if you haven't done
so already.

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

On Sun, 4 Aug 2002, The Kelley's wrote:

> Well I bought the book and the URL that was supposed to have a tutorial on
> how to install JSTL in Tomcat is forbidden.
> Anyone have a clue?
>
> Tim
>
> -----Original Message-----
> From: Hans Bergsten [mailto:hans@gefionsoftware.com]
> Sent: Sunday, August 04, 2002 3:01 PM
> To: Tag Libraries Users List
> Subject: Re: using datasource
>
> anand wrote:
> >
> > Well what I mean was how you tell the JSTL to use what datasource.
> > I have more than one datasource defined in config.xml that are
> > Connection pooled.  In web xml
> >
> > Can I just say like this
> >
> > <context-param>
> >   <param-name>
> >        javax.servlet.jsp.jstl.sql.dataSource
> >  </param-name>
> >  <paramvalue>
> >        myDataSource
> >  </param-value>
> > </context-param>
>
> If that's the name it's been registered with in the JNDI java:comp/env/
> context, yes. The J2EE spec recommends that you use a name that starts
> with "jdbc", however, so "jdbc/myDataSource" would be the full name if
> you follow the recommended conventions. The hard rule is that you must
> use the same name as you declare with the <res-ref-name> element in the
> web.xml file for the application.
>
> How to tell the container how to create and configure a data source with
> this name varies between containers. For Tomcat 4, it's done with the
> <ResourceParams> element in the conf/server.xml file. See the Tomcat
> docs for details:
>
>
>
<http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html>
>
> Hans
> <plug>I cover this in great detail in JavaServer Pages, Second Edition
> (O'Reilly), to be released in August</plug>
> --
> Hans Bergsten           hans@gefionsoftware.com
> Gefion Software         http://www.gefionsoftware.com
> JavaServer Pages        http://TheJSPBook.com
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: using datasource

Posted by Shawn Bayern <ba...@essentially.net>.
If you mean the "JSTL in Action" book, that link will be up tomorrow; it
was timed for the printed edition, not the ebook.  If you want to get up
and running today, we have a little bundle of JSTL + Tomcat + the book's
examples at

  http://www.manning.com/getpage.html?project=bayern&filename=source.html

This lets you avoid having to set up Tomcat with JSTL, if you haven't done
so already.

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

On Sun, 4 Aug 2002, The Kelley's wrote:

> Well I bought the book and the URL that was supposed to have a tutorial on
> how to install JSTL in Tomcat is forbidden.
> Anyone have a clue?
> 
> Tim
> 
> -----Original Message-----
> From: Hans Bergsten [mailto:hans@gefionsoftware.com]
> Sent: Sunday, August 04, 2002 3:01 PM
> To: Tag Libraries Users List
> Subject: Re: using datasource
> 
> anand wrote:
> >
> > Well what I mean was how you tell the JSTL to use what datasource.
> > I have more than one datasource defined in config.xml that are
> > Connection pooled.  In web xml
> >
> > Can I just say like this
> >
> > <context-param>
> >   <param-name>
> >        javax.servlet.jsp.jstl.sql.dataSource
> >  </param-name>
> >  <paramvalue>
> >        myDataSource
> >  </param-value>
> > </context-param>
> 
> If that's the name it's been registered with in the JNDI java:comp/env/
> context, yes. The J2EE spec recommends that you use a name that starts
> with "jdbc", however, so "jdbc/myDataSource" would be the full name if
> you follow the recommended conventions. The hard rule is that you must
> use the same name as you declare with the <res-ref-name> element in the
> web.xml file for the application.
> 
> How to tell the container how to create and configure a data source with
> this name varies between containers. For Tomcat 4, it's done with the
> <ResourceParams> element in the conf/server.xml file. See the Tomcat
> docs for details:
> 
> 
> <http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html>
> 
> Hans
> <plug>I cover this in great detail in JavaServer Pages, Second Edition
> (O'Reilly), to be released in August</plug>
> --
> Hans Bergsten           hans@gefionsoftware.com
> Gefion Software         http://www.gefionsoftware.com
> JavaServer Pages        http://TheJSPBook.com
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: using datasource

Posted by The Kelley's <ti...@mindspring.com>.
Well I bought the book and the URL that was supposed to have a tutorial on
how to install JSTL in Tomcat is forbidden.
Anyone have a clue?

Tim

-----Original Message-----
From: Hans Bergsten [mailto:hans@gefionsoftware.com]
Sent: Sunday, August 04, 2002 3:01 PM
To: Tag Libraries Users List
Subject: Re: using datasource

anand wrote:
>
> Well what I mean was how you tell the JSTL to use what datasource.
> I have more than one datasource defined in config.xml that are
> Connection pooled.  In web xml
>
> Can I just say like this
>
> <context-param>
>   <param-name>
>        javax.servlet.jsp.jstl.sql.dataSource
>  </param-name>
>  <paramvalue>
>        myDataSource
>  </param-value>
> </context-param>

If that's the name it's been registered with in the JNDI java:comp/env/
context, yes. The J2EE spec recommends that you use a name that starts
with "jdbc", however, so "jdbc/myDataSource" would be the full name if
you follow the recommended conventions. The hard rule is that you must
use the same name as you declare with the <res-ref-name> element in the
web.xml file for the application.

How to tell the container how to create and configure a data source with
this name varies between containers. For Tomcat 4, it's done with the
<ResourceParams> element in the conf/server.xml file. See the Tomcat
docs for details:


<http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html>

Hans
<plug>I cover this in great detail in JavaServer Pages, Second Edition
(O'Reilly), to be released in August</plug>
--
Hans Bergsten           hans@gefionsoftware.com
Gefion Software         http://www.gefionsoftware.com
JavaServer Pages        http://TheJSPBook.com


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: using datasource

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
The Kelley's wrote:
> I have never used JNDI.    I read the Tomcat docs but until I see an example
> using JSTL...... What I would give for one spoon fed example.

Get my book when it's relased ;-) Seriously, configuration of an object
factory for JNDI in Tomcat 4 to date is harder than it should be, mainly
because the default DataSource factory bundled with Tomcat 4 seems to be
buggy and no longer supported. I believe Tomcat 4.1 bundles a JNDI
object factory and DataSource from Jakarta Commons instead, which should
be an improvement. But even with Tomcat 4 it's not that hard to and the
doc I referred to earlier is pretty good.

> Do I understand the JSTL in Action text correctly..
> 
> The text
> However, the <sql:setDataSource> tag does not support connection pooling.
> It's not designed to do so. Instead, Java programmers who set up default
> databases
> for JSP pages have ample opportunity to set up their own pooling strategies.
> Doing
> so makes <sql:setDataSource> suitable only for applications where high
> performance
> isn't crucial. In particular, <sql:setDataSource> is great for small
> applications,
> 
> That's why I bought the book to use with databases. Arg!!!
> Can I use JSTL with connection pooling? Doesn't sound like it.

Sure you can. You just have to make a DataSource that implements
connection pooling available to the JSTL actions. The only thing
the quoted text (and the JSTL spec) says is that the DataSource
created by the <sql:setDataSource> action does not provide pooling.

If you think JNDI is to messy, you can make a DataSource with pooling
capabilities available through other means, for instance with an
application lifecycle listener. This one creates an instance of Oracle's
DataSource and saves a reference to it as an application scope variable
that you can then use in the JNDI actions:

package com.ora.jsp.servlets;
import javax.servlet.*;
import javax.servlet.http.*;
import oracle.jdbc.pool.*;
public class ResourceManagerListener2 implements
   ServletContextListener {
   private OracleConnectionCacheImpl ds =null;

   public void contextInitialized(ServletContextEvent sce){
     ServletContext application = sce.getServletContext();
     String jdbcURL = application.getInitParameter("jdbcURL");
     String user = application.getInitParameter("user");
     String password = application.getInitParameter("password");
     String maxLimit = application.getInitParameter("maxLimit");
     try {
       ds = new OracleConnectionCacheImpl();
       ds.setURL(jdbcURL);
       ds.setMaxLimit(Integer.parseInt(maxLimit));
       ds.setUser("scott");
       ds.setPassword("tiger");
     }
     catch (Exception e){
       application.log("Failed to create data source:" +
         e.getMessage());
     }
     application.setAttribute("appDataSource", ds);
   }
   ...
}

You can use it like this:

   <sql:query dataSource="${appDataSource}" ... />

If you let the listener save the reference as the default DataSource,
you don't even have to use the "dataSource" attribute:

   public void contextInitialized(ServletContextEvent sce){
     ...
     Config.set(application, Config.SQL_DATASOURCE, ds);
   }

   <sql:query ... />

I hope this helps. To learn more about this, I suggest you read the
JSTL spec until books and more articles about JSTL are available.

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
JavaServer Pages	http://TheJSPBook.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: using datasource

Posted by Shawn Bayern <ba...@essentially.net>.
On Sun, 4 Aug 2002, The Kelley's wrote:

> I have never used JNDI.    I read the Tomcat docs but until I see an example
> using JSTL...... What I would give for one spoon fed example.
> 
> Do I understand the JSTL in Action text correctly..
> 
> The text However, the <sql:setDataSource> tag does not support
> connection pooling. It's not designed to do so. Instead, Java
> programmers who set up default databases for JSP pages have ample
> opportunity to set up their own pooling strategies. Doing so makes
> <sql:setDataSource> suitable only for applications where high
> performance isn't crucial. In particular, <sql:setDataSource> is great
> for small applications,
> 
> That's why I bought the book to use with databases. Arg!!! Can I use
> JSTL with connection pooling? Doesn't sound like it. Tim

This just applies to the <sql:setDataSource> tag, which is intended mostly
for prototypes and small applications.  But you can make any DataSource
available in any of the scopes and then refer to it directly using the
expression language.  (Or see chapter 14 of "JSTL in Action" to see how to
set up a default DataSource object for all of your <sql:*> tags.)

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


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: using datasource

Posted by The Kelley's <ti...@mindspring.com>.
I have never used JNDI.    I read the Tomcat docs but until I see an example
using JSTL...... What I would give for one spoon fed example.

Do I understand the JSTL in Action text correctly..

The text
However, the <sql:setDataSource> tag does not support connection pooling.
It's not designed to do so. Instead, Java programmers who set up default
databases
for JSP pages have ample opportunity to set up their own pooling strategies.
Doing
so makes <sql:setDataSource> suitable only for applications where high
performance
isn't crucial. In particular, <sql:setDataSource> is great for small
applications,

That's why I bought the book to use with databases. Arg!!!
Can I use JSTL with connection pooling? Doesn't sound like it.
Tim





-----Original Message-----
From: Hans Bergsten [mailto:hans@gefionsoftware.com]
Sent: Sunday, August 04, 2002 3:01 PM
To: Tag Libraries Users List
Subject: Re: using datasource

anand wrote:
>
> Well what I mean was how you tell the JSTL to use what datasource.
> I have more than one datasource defined in config.xml that are
> Connection pooled.  In web xml
>
> Can I just say like this
>
> <context-param>
>   <param-name>
>        javax.servlet.jsp.jstl.sql.dataSource
>  </param-name>
>  <paramvalue>
>        myDataSource
>  </param-value>
> </context-param>

If that's the name it's been registered with in the JNDI java:comp/env/
context, yes. The J2EE spec recommends that you use a name that starts
with "jdbc", however, so "jdbc/myDataSource" would be the full name if
you follow the recommended conventions. The hard rule is that you must
use the same name as you declare with the <res-ref-name> element in the
web.xml file for the application.

How to tell the container how to create and configure a data source with
this name varies between containers. For Tomcat 4, it's done with the
<ResourceParams> element in the conf/server.xml file. See the Tomcat
docs for details:


<http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html>

Hans
<plug>I cover this in great detail in JavaServer Pages, Second Edition
(O'Reilly), to be released in August</plug>
--
Hans Bergsten           hans@gefionsoftware.com
Gefion Software         http://www.gefionsoftware.com
JavaServer Pages        http://TheJSPBook.com


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: using datasource

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
anand wrote:
> 
> Well what I mean was how you tell the JSTL to use what datasource.
> I have more than one datasource defined in config.xml that are
> Connection pooled.  In web xml
> 
> Can I just say like this
> 
> <context-param>
>   <param-name>
>        javax.servlet.jsp.jstl.sql.dataSource
>  </param-name>
>  <paramvalue>
>        myDataSource
>  </param-value>
> </context-param>

If that's the name it's been registered with in the JNDI java:comp/env/
context, yes. The J2EE spec recommends that you use a name that starts
with "jdbc", however, so "jdbc/myDataSource" would be the full name if
you follow the recommended conventions. The hard rule is that you must
use the same name as you declare with the <res-ref-name> element in the
web.xml file for the application.

How to tell the container how to create and configure a data source with
this name varies between containers. For Tomcat 4, it's done with the
<ResourceParams> element in the conf/server.xml file. See the Tomcat
docs for details:

 
<http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html>

Hans
<plug>I cover this in great detail in JavaServer Pages, Second Edition
(O'Reilly), to be released in August</plug>
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
JavaServer Pages	http://TheJSPBook.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: using datasource

Posted by anand <an...@columbus.rr.com>.
Normally the connection pooling is done by the Servlets container (the
web server)
I use BEA Weblogic and I setup my datasource and connection pooling in
the config.xml. Then in each of my web application descriptor (web.xml)
I specify which datasource to use.

The JNDI datasource is defined as part of your JSP web server
configuration.



-----Original Message-----
From: The Kelley's [mailto:timdona@mindspring.com] 
Sent: Sunday, August 04, 2002 1:28 PM
To: Tag Libraries Users List; anand@columbus.rr.com
Subject: RE: using datasource 

I don't have to write a servlet that specifies the JNDI?
How would I specify how many connections and so forth.
If JSTL does all this, I'll buy the book and start using it.
Tim


-----Original Message-----
From: anand [mailto:anand@columbus.rr.com]
Sent: Sunday, August 04, 2002 12:11 PM
To: 'Tag Libraries Users List'
Subject: RE: using datasource


Well what I mean was how you tell the JSTL to use what datasource.
I have more than one datasource defined in config.xml that are
Connection pooled.  In web xml

Can I just say like this

<context-param>
  <param-name>
       javax.servlet.jsp.jstl.sql.dataSource
 </param-name>
 <paramvalue>
       myDataSource
 </param-value>
</context-param>

-----Original Message-----
From: anand [mailto:anand@columbus.rr.com]
Sent: Sunday, August 04, 2002 12:01 PM
To: 'Tag Libraries Users List'
Subject: using datasource

Does anyone know the syntax for coding datasource in the
Web.xml, can you give an example please.

Thanks,

-Dave


-----Original Message-----
From: Shawn Bayern [mailto:bayern@essentially.net]
Sent: Sunday, August 04, 2002 9:24 AM
To: Tag Libraries Users List; timdona@mindspring.com
Subject: RE: JSTL in Action: first few chapters

On Sun, 4 Aug 2002, The Kelley's wrote:

> Can JSTL use connection pooling for a databases?

JSTL lets you configure any DataSource to access a database.  The
DataSource may indeed implement connection pooling.  Setting it up is as
easy as pointing to a pooling DataSource in your application's web.xml.

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


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: using datasource

Posted by The Kelley's <ti...@mindspring.com>.
I don't have to write a servlet that specifies the JNDI?
How would I specify how many connections and so forth.
If JSTL does all this, I'll buy the book and start using it.
Tim


-----Original Message-----
From: anand [mailto:anand@columbus.rr.com]
Sent: Sunday, August 04, 2002 12:11 PM
To: 'Tag Libraries Users List'
Subject: RE: using datasource


Well what I mean was how you tell the JSTL to use what datasource.
I have more than one datasource defined in config.xml that are
Connection pooled.  In web xml

Can I just say like this

<context-param>
  <param-name>
       javax.servlet.jsp.jstl.sql.dataSource
 </param-name>
 <paramvalue>
       myDataSource
 </param-value>
</context-param>

-----Original Message-----
From: anand [mailto:anand@columbus.rr.com]
Sent: Sunday, August 04, 2002 12:01 PM
To: 'Tag Libraries Users List'
Subject: using datasource

Does anyone know the syntax for coding datasource in the
Web.xml, can you give an example please.

Thanks,

-Dave


-----Original Message-----
From: Shawn Bayern [mailto:bayern@essentially.net]
Sent: Sunday, August 04, 2002 9:24 AM
To: Tag Libraries Users List; timdona@mindspring.com
Subject: RE: JSTL in Action: first few chapters

On Sun, 4 Aug 2002, The Kelley's wrote:

> Can JSTL use connection pooling for a databases?

JSTL lets you configure any DataSource to access a database.  The
DataSource may indeed implement connection pooling.  Setting it up is as
easy as pointing to a pooling DataSource in your application's web.xml.

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


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: using datasource

Posted by anand <an...@columbus.rr.com>.

Well what I mean was how you tell the JSTL to use what datasource.
I have more than one datasource defined in config.xml that are
Connection pooled.  In web xml

Can I just say like this

<context-param>
  <param-name>
       javax.servlet.jsp.jstl.sql.dataSource
 </param-name>
 <paramvalue>
       myDataSource
 </param-value>
</context-param>

-----Original Message-----
From: anand [mailto:anand@columbus.rr.com] 
Sent: Sunday, August 04, 2002 12:01 PM
To: 'Tag Libraries Users List'
Subject: using datasource 

Does anyone know the syntax for coding datasource in the
Web.xml, can you give an example please.

Thanks,

-Dave


-----Original Message-----
From: Shawn Bayern [mailto:bayern@essentially.net] 
Sent: Sunday, August 04, 2002 9:24 AM
To: Tag Libraries Users List; timdona@mindspring.com
Subject: RE: JSTL in Action: first few chapters

On Sun, 4 Aug 2002, The Kelley's wrote:

> Can JSTL use connection pooling for a databases?

JSTL lets you configure any DataSource to access a database.  The
DataSource may indeed implement connection pooling.  Setting it up is as
easy as pointing to a pooling DataSource in your application's web.xml.

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


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


using datasource

Posted by anand <an...@columbus.rr.com>.
Does anyone know the syntax for coding datasource in the
Web.xml, can you give an example please.

Thanks,

-Dave


-----Original Message-----
From: Shawn Bayern [mailto:bayern@essentially.net] 
Sent: Sunday, August 04, 2002 9:24 AM
To: Tag Libraries Users List; timdona@mindspring.com
Subject: RE: JSTL in Action: first few chapters

On Sun, 4 Aug 2002, The Kelley's wrote:

> Can JSTL use connection pooling for a databases?

JSTL lets you configure any DataSource to access a database.  The
DataSource may indeed implement connection pooling.  Setting it up is as
easy as pointing to a pooling DataSource in your application's web.xml.

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


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JSTL in Action: first few chapters

Posted by Shawn Bayern <ba...@essentially.net>.
On Sun, 4 Aug 2002, The Kelley's wrote:

> Can JSTL use connection pooling for a databases?

JSTL lets you configure any DataSource to access a database.  The
DataSource may indeed implement connection pooling.  Setting it up is as
easy as pointing to a pooling DataSource in your application's web.xml.

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


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JSTL in Action: first few chapters

Posted by The Kelley's <ti...@mindspring.com>.
Hey thanks for the book info.

Can JSTL use connection pooling for a databases?
Tim


-----Original Message-----
From: David M. Karr [mailto:dmkarr@earthlink.net]
Sent: Sunday, August 04, 2002 2:18 AM
To: taglibs-user@jakarta.apache.org
Subject: Re: JSTL in Action: first few chapters

>>>>> "Dave" == Dave Newton <da...@solaraccess.com> writes:

    Dave> Peter Lin wrote:
    >> reading the spec isn't always as simple as one would
    >> like. For example, the use of hashmap was totally
    >> clear to me, until I read the section in shawn's book.
    >>

    Dave> Er...         :D

    Dave> Dave

Yeah, yeah, we know what he meant :) .


--
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL in Action: first few chapters

Posted by Peter Lin <tc...@yahoo.com>.
Now if only I learned to proof read or type :P
 
I skimmed through expression language portion of the book and found it easier to read than the official spec.
 
peter
 "David M. Karr" wrote:>>>>> "Dave" == Dave Newton writes:

Dave> Peter Lin wrote:
>> reading the spec isn't always as simple as one would
>> like. For example, the use of hashmap was totally
>> clear to me, until I read the section in shawn's book.
>> 

Dave> Er... :D

Dave> Dave

Yeah, yeah, we know what he meant :) .


-- 
===================================================================
David M. Karr ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do You Yahoo!?
Yahoo! Health - Feel better, live better

Re: JSTL in Action: first few chapters

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Dave" == Dave Newton <da...@solaraccess.com> writes:

    Dave> Peter Lin wrote:
    >> reading the spec isn't always as simple as one would
    >> like. For example, the use of hashmap was totally
    >> clear to me, until I read the section in shawn's book.
    >> 

    Dave> Er...         :D

    Dave> Dave

Yeah, yeah, we know what he meant :) .


-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL in Action: first few chapters

Posted by Dave Newton <da...@solaraccess.com>.
Peter Lin wrote:

>reading the spec isn't always as simple as one would
>like. For example, the use of hashmap was totally
>clear to me, until I read the section in shawn's book.
>  
>
Er...         :D

Dave



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL in Action: first few chapters

Posted by Peter Lin <tc...@yahoo.com>.
Someone at work bought an electronic version and
ordered a few copies. If you are serious about using
JSTL, I would recommend it.

reading the spec isn't always as simple as one would
like. For example, the use of hashmap was totally
clear to me, until I read the section in shawn's book.

I must have read the spec a dozen times, but for some
reason I just did get it. Once i saw shawn's example
it was totally clear.

peter

--- Shawn Bayern <ba...@essentially.net> wrote:
> In case anyone's interested, I just found out that
> the first four chapters
> of "JSTL in Action" have been posted for free at
> 
>   http://www.codercoop.com
> 
> These early chapters are ideal for novice page
> authors; if you're a
> developer, you might want to forward them to page
> authors you work with.
> The chapters cover the principles of web
> development, the JSTL expression
> language, and the JSTL conditional tags.
> 
> -- 
> Shawn Bayern
> "JSTL in Action"   http://www.jstlbook.com
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>