tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morgan Delagrange <mdela...@yahoo.com>
Subject Re: DBTags initparameter Problem
Date Thu, 09 Aug 2001 15:24:17 GMT
That's not the right kind of init parameter.  You want
to set a general "context parameter" in your web.xml,
not an init parameter for a particular servlet.

--- "P.Miller" <p.miller@brocom.de> wrote:
> Hello,
> 
> I try to use the DBTags with initparameters in
> web.xml like:
> 
> web.xml:
> 
> <servlet>
>       <servlet-name>dbURL</servlet-name>
>      
>
<servlet-class>org.apache.taglibs.dbtags.connection.DatabaseURLTag</servlet-class>
>       <init-param>
>          <param-name>oraURL</param-name>
>         
>
<param-value>jdbc:oracle:thin:@192.168.1.200:1521:ORC1</param-value>
>       </init-param>
> </servlet>
> 
> <servlet>
>       <servlet-name>dbDriver</servlet-name>
>      
>
<servlet-class>org.apache.taglibs.dbtags.connection.DriverTag</servlet-class>
>       <init-param>
>          <param-name>oraDriver</param-name>
>         
>
<param-value>oracle.jdbc.driver.OracleDriver</param-value>
>       </init-param>
> </servlet>
> 
> <servlet>
>       <servlet-name>dbUserId</servlet-name>
>      
>
<servlet-class>org.apache.taglibs.dbtags.connection.UserIdTag</servlet-class>
>       <init-param>
>          <param-name>oraUserId</param-name>
>          <param-value>xyz</param-value>
>       </init-param>
> </servlet>
> 
> <servlet>
>       <servlet-name>dbPassword</servlet-name>
>      
>
<servlet-class>org.apache.taglibs.dbtags.connection.PasswordTag</servlet-class>
>       <init-param>
>          <param-name>oraPassword</param-name>
>          <param-value>xyz</param-value>
>       </init-param>
> </servlet>
> 
> to define the init parameters.
> When I try to use them in a jsp-file:
> 
> <%-- store your connection info in the web.xml file
> --%>
> <sql:connection id="conn1">
>   <sql:url initParameter="oraURL"/> 
>   <sql:driver initParameter="oraDriver"/>
>   <sql:userId initParameter="oraUserId"/> 
>   <sql:password initParameter="oraPassword"/>
> </sql:connection>
> 
> I allways get the error:
> javax.Servlet.ServletException: Driver '' class
> not found
> 
> I thought the methods in the Tag-classes
> 
>   /**
>    * The name of the init parameter containing the
> driver name.
>    * 
>    * @param paramName driver class name
>    */
>   public void setInitParameter(String paramName) {
>     _driverClass =
>
pageContext.getServletContext().getInitParameter(paramName);
>   }
> 
> looks in web.xml for this parameters??
> 
> Any help would be greatly appreciated.
> 
> Peter


=====
Morgan Delagrange
Britannica.com

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Mime
View raw message