tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "P.Miller" <p.mil...@brocom.de>
Subject DBTaglibs - initparameter problem
Date Thu, 09 Aug 2001 07:33:12 GMT
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

Mime
View raw message