You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by ho...@apache.org on 2002/01/16 03:22:20 UTC

cvs commit: jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql DriverTag.java QueryTag.java UpdateTag.java TransactionTag.java

horwat      02/01/15 18:22:20

  Modified:    standard/conf sql-rt.tld sql.tld
               standard/doc/web DB_FunctionalDescription_1_EA3.html
                        Overview.html
               standard/examples/web/sql DriverSetup.jsp QueryDirect.jsp
                        QueryIterate.jsp QueryParam.jsp Transaction.jsp
                        Update.jsp
               standard/src/org/apache/taglibs/standard/tag/common/sql
                        QueryTagSupport.java UpdateTagSupport.java
                        TransactionTagSupport.java
               standard/src/org/apache/taglibs/standard/tag/el/sql
                        DriverTag.java QueryTag.java UpdateTag.java
                        TransactionTag.java
  Log:
  Fixes for discreptancies between JSTL SQL Functional Description and implementation. List of fixes:
  	- <sql:driver>: use "Url" attribute instead of "jdbcUrl" (FD) or "jdbcURL" (implementation
  	- <sql:driver>: added "scope" attribute
  	- <sql:param>: made "value" attribute optional
  	- <sql:query>,<sql:update>: search for scoped DataSource object or perform JNDI lookup if it is a String
  		- "javax.servlet.jsp.jstl.DataSource" changed to "javax.servlet.jsp.jstl.sql.dataSource" for consistency
  	- <sql:transaction>: added "transactionIsolation" attribute
  
  Reported by: Jan Luehe
  
  Revision  Changes    Path
  1.5       +7 -2      jakarta-taglibs/standard/conf/sql-rt.tld
  
  Index: sql-rt.tld
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/conf/sql-rt.tld,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- sql-rt.tld	2 Jan 2002 19:42:01 -0000	1.4
  +++ sql-rt.tld	16 Jan 2002 02:22:19 -0000	1.5
  @@ -113,7 +113,7 @@
       </description>
       <attribute>
           <name>value</name>
  -        <required>true</required>
  +        <required>false</required>
           <rtexprvalue>true</rtexprvalue>
       </attribute>
     </tag>
  @@ -131,12 +131,17 @@
           <rtexprvalue>false</rtexprvalue>
       </attribute>
       <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
           <name>driverClassName</name>
           <required>false</required>
           <rtexprvalue>true</rtexprvalue>
       </attribute>
       <attribute>
  -        <name>jdbcURL</name>
  +        <name>url</name>
           <required>false</required>
           <rtexprvalue>true</rtexprvalue>
       </attribute>
  
  
  
  1.6       +13 -3     jakarta-taglibs/standard/conf/sql.tld
  
  Index: sql.tld
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/conf/sql.tld,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- sql.tld	2 Jan 2002 19:42:01 -0000	1.5
  +++ sql.tld	16 Jan 2002 02:22:19 -0000	1.6
  @@ -26,7 +26,7 @@
           update:dataSource
           param:value
           driver:driver
  -        driver:jdbcURL
  +        driver:url
           driver:userName
           </param-value>
           <description>
  @@ -61,6 +61,11 @@
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  +    <attribute>
  +        <name>transactionIsolation</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>
   
     <tag>
  @@ -142,7 +147,7 @@
       </description>
       <attribute>
           <name>value</name>
  -        <required>true</required>
  +        <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
     </tag>
  @@ -160,12 +165,17 @@
           <rtexprvalue>false</rtexprvalue>
       </attribute>
       <attribute>
  +        <name>scope</name>
  +        <required>false</required>
  +        <rtexprvalue>false</rtexprvalue>
  +    </attribute>
  +    <attribute>
           <name>driver</name>
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
       <attribute>
  -        <name>jdbcURL</name>
  +        <name>url</name>
           <required>false</required>
           <rtexprvalue>false</rtexprvalue>
       </attribute>
  
  
  
  1.6       +4 -4      jakarta-taglibs/standard/doc/web/DB_FunctionalDescription_1_EA3.html
  
  Index: DB_FunctionalDescription_1_EA3.html
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/doc/web/DB_FunctionalDescription_1_EA3.html,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DB_FunctionalDescription_1_EA3.html	18 Dec 2001 01:10:36 -0000	1.5
  +++ DB_FunctionalDescription_1_EA3.html	16 Jan 2002 02:22:19 -0000	1.6
  @@ -63,7 +63,7 @@
     <p>1. Transparent collaboration (implicit scoped attribute)</p>
     <p>Initialization code in the application logic (e.g. application event listener, 
       initialization servlet) can be used to set the default DataSource associated 
  -    with a web application via the scoped attribute &quot;javax.servlet.jsp.jstl.DataSource&quot;. 
  +    with a web application via the scoped attribute &quot;javax.servlet.jsp.jstl.sql.dataSource&quot;. 
       With this approach, an application with a single database makes the DataSource 
       that is being used by the database actions totally transparent to the page 
       author</p>
  @@ -223,7 +223,7 @@
       &lt;sql:transaction&gt; tag, retrieve a Connection from our parent and do 
       nothing to release it. The connection is managed by the parent.</li>
     <li>If neither (1) nor (2), then look for a DataSource named by scoped attribute 
  -    &quot;javax.servlet.jsp.jstl.DataSource&quot;. Handling of the connection 
  +    &quot;javax.servlet.jsp.jstl.sql.dataSource&quot;. Handling of the connection 
       is then as described in 1.</li>
   </ol>
   <p>It is illegal for &lt;sql:query&gt; to specify a DataSource when nested within 
  @@ -341,7 +341,7 @@
   <p><code>&lt;sql:driver var=<i>&quot;varName&quot;</i><br>
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[driver=&quot;<i>driverClassName</i>&quot;] 
     <br>
  -  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[url=&quot;<i>jdbcUrl</i>&quot;]<br>
  +  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[url=&quot;<i>url</i>&quot;]<br>
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[user=&quot;<i>userName</i>&quot;] 
     /&gt;</code></p>
   <h4>Details<br>
  @@ -597,7 +597,7 @@
           <code>&lt;sql:driver var=<i>&quot;varName&quot;</i><br>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[driver=&quot;<i>driverClassName</i>&quot;] 
           <br>
  -        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[jdbcUrl=&quot;<i>jdbcUrl</i>&quot;]<br>
  +        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[url=&quot;<i>url</i>&quot;]<br>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[userName=&quot;<i>userName</i>&quot;] 
           /&gt;</code><br>
         </p>
  
  
  
  1.5       +1 -1      jakarta-taglibs/standard/doc/web/Overview.html
  
  Index: Overview.html
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/doc/web/Overview.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Overview.html	12 Dec 2001 20:12:35 -0000	1.4
  +++ Overview.html	16 Jan 2002 02:22:19 -0000	1.5
  @@ -751,7 +751,7 @@
           <code>&lt;sql:driver var=<i>&quot;varName&quot;</i><br>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[driver=&quot;<i>driverClassName</i>&quot;] 
           <br>
  -        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[jdbcUrl=&quot;<i>jdbcUrl</i>&quot;]<br>
  +        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[url=&quot;<i>url</i>&quot;]<br>
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[userName=&quot;<i>userName</i>&quot;] 
           /&gt;</code><br>
         </p>
  
  
  
  1.2       +1 -1      jakarta-taglibs/standard/examples/web/sql/DriverSetup.jsp
  
  Index: DriverSetup.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/sql/DriverSetup.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DriverSetup.jsp	12 Dec 2001 21:44:18 -0000	1.1
  +++ DriverSetup.jsp	16 Jan 2002 02:22:20 -0000	1.2
  @@ -13,7 +13,7 @@
   &lt;sql:driver
     var="example"
     driver="RmiJdbc.RJDriver"
  -  jdbcURL="jdbc:rmi://gibson:1099/jdbc:cloudscape:CloudscapeDB"
  +  url="jdbc:rmi://localhost:1099/jdbc:cloudscape:CloudscapeDB;create=true"
   /&gt;
   </pre>
   </code>
  
  
  
  1.3       +1 -1      jakarta-taglibs/standard/examples/web/sql/QueryDirect.jsp
  
  Index: QueryDirect.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/sql/QueryDirect.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- QueryDirect.jsp	19 Dec 2001 01:48:58 -0000	1.2
  +++ QueryDirect.jsp	16 Jan 2002 02:22:20 -0000	1.3
  @@ -16,7 +16,7 @@
   <sql:driver
     var="example"
     driver="$myDbDriver"
  -  jdbcURL="$myDbUrl"
  +  url="$myDbUrl"
   />
   
   <sql:transaction dataSource="$example">
  
  
  
  1.3       +1 -1      jakarta-taglibs/standard/examples/web/sql/QueryIterate.jsp
  
  Index: QueryIterate.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/sql/QueryIterate.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- QueryIterate.jsp	19 Dec 2001 01:48:58 -0000	1.2
  +++ QueryIterate.jsp	16 Jan 2002 02:22:20 -0000	1.3
  @@ -15,7 +15,7 @@
   <sql:driver
     var="example"
     driver="$myDbDriver"
  -  jdbcURL="$myDbUrl"
  +  url="$myDbUrl"
   />
   
   <sql:transaction dataSource="$example">
  
  
  
  1.3       +1 -1      jakarta-taglibs/standard/examples/web/sql/QueryParam.jsp
  
  Index: QueryParam.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/sql/QueryParam.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- QueryParam.jsp	19 Dec 2001 01:48:58 -0000	1.2
  +++ QueryParam.jsp	16 Jan 2002 02:22:20 -0000	1.3
  @@ -19,7 +19,7 @@
   <sql:driver
     var="example"
     driver="$myDbDriver"
  -  jdbcURL="$myDbUrl"
  +  url="$myDbUrl"
   />
   
   <sql:transaction dataSource="$example">
  
  
  
  1.2       +1 -1      jakarta-taglibs/standard/examples/web/sql/Transaction.jsp
  
  Index: Transaction.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/sql/Transaction.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Transaction.jsp	12 Dec 2001 21:44:18 -0000	1.1
  +++ Transaction.jsp	16 Jan 2002 02:22:20 -0000	1.2
  @@ -14,7 +14,7 @@
   <sql:driver
     var="example"
     driver="$myDbDriver"
  -  jdbcURL="$myDbUrl"
  +  url="$myDbUrl"
   />
   
   <p>You can group transactions together using the &lt;sql:transaction&gt; tag.</p>
  
  
  
  1.3       +1 -1      jakarta-taglibs/standard/examples/web/sql/Update.jsp
  
  Index: Update.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/sql/Update.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Update.jsp	19 Dec 2001 01:48:58 -0000	1.2
  +++ Update.jsp	16 Jan 2002 02:22:20 -0000	1.3
  @@ -15,7 +15,7 @@
   <sql:driver
     var="example"
     driver="$myDbDriver"
  -  jdbcURL="$myDbUrl"
  +  url="$myDbUrl"
   />
   
   <hr>
  
  
  
  1.5       +35 -1     jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java
  
  Index: QueryTagSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/QueryTagSupport.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- QueryTagSupport.java	4 Jan 2002 21:59:01 -0000	1.4
  +++ QueryTagSupport.java	16 Jan 2002 02:22:20 -0000	1.5
  @@ -62,6 +62,9 @@
   import javax.servlet.jsp.*;
   import javax.servlet.jsp.jstl.sql.*;
   import javax.servlet.jsp.tagext.*;
  +import javax.naming.InitialContext;
  +import javax.naming.Context;
  +import javax.naming.NamingException;
   import org.apache.taglibs.standard.resources.Resources;
   
   
  @@ -69,6 +72,7 @@
    * <p>Tag handler for &lt;Query&gt; in JSTL.  
    * 
    * @author Hans Bergsten
  + * @author Justyna Horwat
    */
   
   public abstract class QueryTagSupport extends BodyTagSupport 
  @@ -77,6 +81,9 @@
       private static final String MAX_ROWS =
           "javax.servlet.jsp.jstl.sql.maxRows";
   
  +    private static final String DATASOURCE =
  +        "javax.servlet.jsp.jstl.sql.dataSource";
  +
       private String var;
       private int scope;
       private int maxRows;
  @@ -88,6 +95,7 @@
        * setter methods are implemented by the expression type
        * specific subclasses.
        */
  +    protected Object rawDataSource;
       protected DataSource dataSource;
       protected String sql;
   
  @@ -190,6 +198,8 @@
        * getting the <code>Connection</code>
        */
       public int doStartTag() throws JspException {
  +
  +        setDataSource();
   	try {
   	    conn = getConnection();
   	}
  @@ -211,7 +221,7 @@
        * from the <code>DataSource</code> specified by the
        * <code>dataSource</code> attribute, provided by a parent action
        * element, or is retrieved from a JSP scope  attribute
  -     * named <code>javax.servlet.jsptl.DataSource</code>.
  +     * named <code>javax.servlet.jstl.sql.dataSource</code>.
        */
       public int doEndTag() throws JspException {
   	/*
  @@ -276,6 +286,30 @@
   
       //*********************************************************************
       // Private utility methods
  +
  +    private void setDataSource() throws JspException {
  +
  +        if (rawDataSource != null) {
  +            // If the 'dataSource' attribute's value resolves to a String
  +            // after rtexpr/EL evaluation, use the string as JNDI path to 
  +            // a DataSource
  +            if (rawDataSource instanceof String) {
  +                try {
  +                    Context ctx = new InitialContext();
  +                    dataSource = (DataSource) ctx.lookup((String)rawDataSource);
  +                } catch (NamingException ex) {
  +                    throw new JspTagException(ex.toString());
  +                }
  +            }
  +            else dataSource = (DataSource) rawDataSource;
  +        }
  +        else {
  +            ServletContext application = pageContext.getServletContext();
  +            dataSource = (DataSource) pageContext.findAttribute(
  +                application.getInitParameter(DATASOURCE));
  +        }
  +    }
  +
   
       private Connection getConnection() throws SQLException {
   	// Fix: Add all other mechanisms
  
  
  
  1.6       +35 -1     jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/UpdateTagSupport.java
  
  Index: UpdateTagSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/UpdateTagSupport.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- UpdateTagSupport.java	4 Jan 2002 21:59:01 -0000	1.5
  +++ UpdateTagSupport.java	16 Jan 2002 02:22:20 -0000	1.6
  @@ -58,20 +58,28 @@
   import java.sql.*;
   import java.util.*;
   import javax.sql.*;
  +import javax.servlet.*;
   import javax.servlet.jsp.*;
   import javax.servlet.jsp.jstl.sql.*;
   import javax.servlet.jsp.tagext.*;
  +import javax.naming.InitialContext;
  +import javax.naming.Context;
  +import javax.naming.NamingException;
   import org.apache.taglibs.standard.resources.Resources;
   
   /**
    * <p>Tag handler for &lt;Update&gt; in JSTL.  
    * 
    * @author Hans Bergsten
  + * @author Justyna Horwat
    */
   
   public abstract class UpdateTagSupport extends BodyTagSupport 
       implements TryCatchFinally, SQLExecutionTag {
   
  +    private static final String DATASOURCE =
  +        "javax.servlet.jsp.jstl.sql.dataSource";
  +
       private String var;
       private int scope = PageContext.PAGE_SCOPE;
   
  @@ -80,6 +88,7 @@
        * setter methods are implemented by the expression type
        * specific subclasses.
        */
  +    protected Object rawDataSource;
       protected DataSource dataSource;
       protected String sql;
   
  @@ -144,6 +153,8 @@
        * getting the <code>Connection</code>
        */
       public int doStartTag() throws JspException {
  +
  +        setDataSource();
   	try {
   	    conn = getConnection();
   	}
  @@ -165,7 +176,7 @@
        * from the <code>DataSource</code> specified by the
        * <code>dataSource</code> attribute, provided by a parent action
        * element, or is retrieved from a JSP scope  attribute
  -     * named <code>javax.servlet.jsptl.DataSource</code>.
  +     * named <code>javax.servlet.jsp.jstl.sql.dataSource</code>.
        */
       public int doEndTag() throws JspException {
   	/*
  @@ -227,6 +238,29 @@
   
       //*********************************************************************
       // Private utility methods
  +
  +    private void setDataSource() throws JspException {
  +
  +        if (rawDataSource != null) {
  +            // If the 'dataSource' attribute's value resolves to a String
  +            // after rtexpr/EL evaluation, use the string as JNDI path to
  +            // a DataSource
  +            if (rawDataSource instanceof String) {
  +                try {
  +                    Context ctx = new InitialContext();
  +                    dataSource = (DataSource) ctx.lookup((String)rawDataSource);
  +                } catch (NamingException ex) {
  +                    throw new JspTagException(ex.toString());
  +                }
  +            }
  +            else dataSource = (DataSource) rawDataSource;
  +        }
  +        else {
  +            ServletContext application = pageContext.getServletContext();
  +            dataSource = (DataSource) pageContext.findAttribute(
  +                application.getInitParameter(DATASOURCE));
  +        }
  +    }
   
       private Connection getConnection() throws SQLException {
   	// Fix: Add all other mechanisms
  
  
  
  1.3       +35 -0     jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/TransactionTagSupport.java
  
  Index: TransactionTagSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/TransactionTagSupport.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TransactionTagSupport.java	4 Jan 2002 21:59:01 -0000	1.2
  +++ TransactionTagSupport.java	16 Jan 2002 02:22:20 -0000	1.3
  @@ -58,9 +58,13 @@
   import java.sql.*;
   import java.util.*;
   import javax.sql.*;
  +import javax.servlet.*;
   import javax.servlet.jsp.*;
   import javax.servlet.jsp.jstl.sql.*;
   import javax.servlet.jsp.tagext.*;
  +import javax.naming.InitialContext;
  +import javax.naming.Context;
  +import javax.naming.NamingException;
   import org.apache.taglibs.standard.resources.Resources;
   
   
  @@ -73,6 +77,9 @@
   public abstract class TransactionTagSupport extends TagSupport 
       implements TryCatchFinally {
   
  +    private static final String DATASOURCE =
  +        "javax.servlet.jsp.jstl.sql.dataSource";
  +
       private static final int DEFAULT_ISOLATION = -1;
   
       private int transactionIsolation = DEFAULT_ISOLATION;
  @@ -82,6 +89,7 @@
        * setter methods are implemented by the expression type
        * specific subclasses.
        */
  +    protected Object rawDataSource;
       protected DataSource dataSource;
   
       /*
  @@ -134,6 +142,8 @@
        * the transaction.
        */
       public int doStartTag() throws JspException {
  +
  +        setDataSource();
   	try {
   	    conn = getConnection();
   	    int origIsolation = conn.getTransactionIsolation();
  @@ -202,6 +212,31 @@
   
       //*********************************************************************
       // Private utility methods
  +
  +    private void setDataSource() throws JspException {
  +
  +        if (rawDataSource != null) {
  +            // If the 'dataSource' attribute's value resolves to a String
  +            // after rtexpr/EL evaluation, use the string as JNDI path to
  +            // a DataSource
  +            if (rawDataSource instanceof String) {
  +                try {
  +                    Context ctx = new InitialContext();
  +                    dataSource = (DataSource) ctx.lookup((String)rawDataSource);
  +                } catch (NamingException ex) {
  +                    throw new JspTagException(ex.toString());
  +                }
  +            }
  +            else {
  +                dataSource = (DataSource) rawDataSource;
  +            }
  +        }
  +        else {
  +            ServletContext application = pageContext.getServletContext();
  +            dataSource = (DataSource) pageContext.findAttribute(
  +                application.getInitParameter(DATASOURCE));
  +        }
  +    }
   
       private Connection getConnection() throws SQLException {
   	// Fix: Add all other mechanisms
  
  
  
  1.2       +2 -2      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql/DriverTag.java
  
  Index: DriverTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql/DriverTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DriverTag.java	12 Dec 2001 22:13:10 -0000	1.1
  +++ DriverTag.java	16 Jan 2002 02:22:20 -0000	1.2
  @@ -77,7 +77,7 @@
   	this.driverClassNameEL = driverClassNameEL;
       }
   
  -    public void setJdbcURL(String jdbcURLEL) {
  +    public void setUrl(String jdbcURLEL) {
   	this.jdbcURLEL = jdbcURLEL;
       }
   
  @@ -107,7 +107,7 @@
   
           if (jdbcURLEL != null) {
                   jdbcURL = (String) ExpressionEvaluatorManager.evaluate
  -                ("jdbcURL", jdbcURLEL, String.class, this, pageContext);
  +                ("Url", jdbcURLEL, String.class, this, pageContext);
           }
   
           if (userNameEL != null) {
  
  
  
  1.2       +3 -2      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql/QueryTag.java
  
  Index: QueryTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql/QueryTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- QueryTag.java	11 Dec 2001 22:13:51 -0000	1.1
  +++ QueryTag.java	16 Jan 2002 02:22:20 -0000	1.2
  @@ -63,6 +63,7 @@
    * Subclass for the JSTL library with EL support.
    *
    * @author Hans Bergsten
  + * @author Justyna Horwat
    */
   public class QueryTag extends QueryTagSupport {
   
  @@ -89,9 +90,9 @@
   
       public int doStartTag() throws JspException {
   	if (dataSourceEL != null) {
  -	    dataSource = (DataSource) 
  +	    rawDataSource = (Object) 
   		ExpressionEvaluatorManager.evaluate("dataSource", 
  -		    dataSourceEL, DataSource.class, this, pageContext);
  +		    dataSourceEL, Object.class, this, pageContext);
   	}
   	if (sqlEL != null) {
   	    sql = (String) ExpressionEvaluatorManager.evaluate("sql", sqlEL, 
  
  
  
  1.2       +2 -2      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql/UpdateTag.java
  
  Index: UpdateTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql/UpdateTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UpdateTag.java	11 Dec 2001 22:13:51 -0000	1.1
  +++ UpdateTag.java	16 Jan 2002 02:22:20 -0000	1.2
  @@ -85,9 +85,9 @@
   
       public int doStartTag() throws JspException {
   	if (dataSourceEL != null) {
  -	    dataSource = (DataSource) 
  +	    rawDataSource = (Object) 
   		ExpressionEvaluatorManager.evaluate("dataSource", 
  -		    dataSourceEL, DataSource.class, this, pageContext);
  +		    dataSourceEL, Object.class, this, pageContext);
   	}
   	if (sqlEL != null) {
   	    sql = (String) ExpressionEvaluatorManager.evaluate("sql", sqlEL, 
  
  
  
  1.2       +2 -2      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql/TransactionTag.java
  
  Index: TransactionTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql/TransactionTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TransactionTag.java	11 Dec 2001 22:13:51 -0000	1.1
  +++ TransactionTag.java	16 Jan 2002 02:22:20 -0000	1.2
  @@ -74,9 +74,9 @@
   
       public int doStartTag() throws JspException {
   	if (dataSourceEL != null) {
  -	    dataSource = (DataSource) 
  +	    rawDataSource = (Object) 
   		ExpressionEvaluatorManager.evaluate("dataSource", 
  -		    dataSourceEL, DataSource.class, this, pageContext);
  +		    dataSourceEL, Object.class, this, pageContext);
   	}
   	return super.doStartTag();
       }
  
  
  

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