That's strange, i had tried setting them as context-param and it appeared to
work fine for me.  Note the context-param tag(s) go directly under the
web-app tag.  You may want to drop the init-param tag.

        <web-app>
        <context-param>
                <param-name>dbUrl</param-name>
                <param-value>jdbc:odbc:deved</param-value>
        </context-param>
        <context-param>
                <param-name>dbDriver</param-name>
                <param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
        </context-param>

Also - i'm always curious to know why folks are preferring to use the DBTags
lib over the SQL actions within JSTL?  I had used DBTags before JSTL RI was
"released", and find it A LOT MORE flexible and "user-friendly".  (This is
not to say that the DBTags team did not do a good job; it's just that JSTL
has really improved on it. 8) )

> Second day on custom tags and I'm having trouble accessing 
> something the
> docs say I should be able to.
> I'm using the jakarta dbtags library and attempting to set 
> the database url,
> driver, userId and password in the web.xml as initParameters 
> as the docs
> suggest is possible.
> However I can't locate where what or how these initParameters 
> are set.  They
> don't seem to be normal context-params.. can anybody set me straight?
> The taglib itself is working fine, I just would rather store 
> these params
> somewhere central.
> 
> I'm using Tomcat 3.3 and the relevant bits of m web.xml 
> currently looks like
> this:
> 
>   <taglib>
>     <taglib-uri>http://jakarta.apache.org/taglibs/dbtags</taglib-uri>
>     <taglib-location>/WEB-INF/dbtags.tld</taglib-location>
>   </taglib>
>   <taglib>
>     <taglib-uri>/dbtags</taglib-uri>
>     <taglib-location>/WEB-INF/lib/dbtags.jar</taglib-location>
>   </taglib>
> 
>   <context-param>
>     <init-param>
>         <param-name>dbURL</param-name>
>         <param-value>jdbc:twtds:sqlserver://blah/blah</param-value>
>         <description>blah blah </description>
>     </init-param>
>  </context-param>
> 
> 
> 
> 
> ************************************************************
> and the DBtags docs suggest I should be able to do this:
> *****************************************
> Instead of including your database URL, driver name, user id, 
> or password
> inside your tag body, you may optionally use the 
> "initParameter" attribute:
> <%-- store your connection info in the web.xml file --%>
> <sql:connection id="conn1">
>   <sql:url initParameter="dbURL"/> 
>   <sql:driver initParameter="mysqlDriver"/>
>   <sql:userId initParameter="dbUserId"/> 
>   <sql:password initParameter="dbPassword"/>
> </sql:connection>
> 
> 
> Tref Gare
> Web Developer MCSD/SCJP
> eCommerce Group
> Phone:        (03) 9221 4106
> Mobile:       0409 556 478
> Fax:  (03) 9941 4295
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to