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: DB connection tag question
Date Fri, 17 Aug 2001 20:24:06 GMT
Why don't you just read the password from a context parameter?  It's
directly supported in the DBTags syntax:

  <sql:password initParameter="<your context parameter here>"/>


----- Original Message -----
From: "Karen E. Lee" <karenlee@nersp.nerdc.ufl.edu>
To: <taglibs-user@jakarta.apache.org>
Sent: Friday, August 17, 2001 1:53 PM
Subject: Re: DB connection tag question


> I am trying to write a little extension to the dbtags tablib which reads a
password from a properties file instead of directly from the body of the
jsp.  At this point out of frustration I have simplified it down to:
>
> ---------------------------------------
> package edu.ufl.osg.dbtags.connection;
>
> import java.io.*;
> import java.util.*;
> import javax.naming.*;
> import javax.servlet.jsp.JspTagException;
> import javax.servlet.jsp.tagext.BodyTagSupport;
> import org.apache.taglibs.dbtags.connection.*;
>
> public class PropFileTag extends BodyTagSupport {
>
>    public int doEndTag() throws JspTagException{
> try {
>     ConnectionTag connTag = (ConnectionTag) findAncestorWithClass(this,
>
Class.forName("org.apache.taglibs.dbtags.connection.ConnectionTag"));
>     connTag.setPassword("myPassword");
> }
>
> catch (Exception e) {
>     e.printStackTrace();
> }
>
> return EVAL_PAGE;
>   }
> }
> ----------------------------------------
>
> This is still returning a null password exception:
>    java.lang.IllegalArgumentException: null password with user:karenlee
>       at
com.ibm.ejs.cm.pool.ConnectionPool.allocateConnection(ConnectionPool.java:47
2)
>
> If I abandon my propfiletag and just use <DBTags:password> it works fine.
Any idea what's going on? Thanks.
>
>
>
> --
> Karen Lee
> Open Systems Group
> Northeast Regional Data Center
> University of Florida
> karenlee@nersp.nerdc.ufl.edu


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Mime
View raw message