You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2002/01/30 02:58:25 UTC
DO NOT REPLY [Bug 6103] -
id attribute does not supported by all html input fields
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6103>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6103
id attribute does not supported by all html input fields
anthony@trams.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|id attribute does not |id attribute does not
|supported by all html input |supported by all html input
|fields |fields
------- Additional Comments From anthony@trams.com 2002-01-30 01:58 -------
Here's one way around it.
The main problem is that they "key" property is not set. Also, the
BeanUtils.populate() method is not matching the correct property names for the
DataSource, from what I can tell. I also removed the throw
UnavailableException because if one dataSource fails to register, it'd be nice
if the ActionServlet would move on to the next one.
Index: src/share/org/apache/struts/action/ActionServlet.java
===================================================================
RCS file: /home/cvspublic/jakarta-
struts/src/share/org/apache/struts/action/ActionServlet.java,v
retrieving revision 1.91
diff -u -r1.91 ActionServlet.java
--- src/share/org/apache/struts/action/ActionServlet.java 23 Jan 2002
18:59:12 -0000 1.91
+++ src/share/org/apache/struts/action/ActionServlet.java 30 Jan 2002
01:34:07 -0000
@@ -809,13 +809,16 @@
BeanUtils.populate(ds, dscs[i].getProperties());
ds.setLogWriter(scw);
if (ds instanceof GenericDataSource) {
- ((GenericDataSource) ds).open();
+ GenericDataSource gds = (GenericDataSource) ds ;
+ gds.setDriverClass((String) dscs[i].getProperties().get
("driverClass")) ;
+ gds.setUrl((String) dscs[i].getProperties().get("url")) ;
+ gds.setUser((String) dscs[i].getProperties().get("user")) ;
+ gds.setPassword((String) dscs[i].getProperties().get
("password")) ;
+ gds.open() ;
}
} catch (Throwable t) {
log(internal.getMessage
("dataSource.init", dscs[i].getKey()), t);
- throw new UnavailableException
- (internal.getMessage("dataSource.init", dscs[i].getKey
()));
}
getServletContext().setAttribute
(dscs[i].getKey() + config.getPrefix(), ds);
Index: src/share/org/apache/struts/config/DataSourceConfig.java
===================================================================
RCS file: /home/cvspublic/jakarta-
struts/src/share/org/apache/struts/config/DataSourceConfig.java,v
retrieving revision 1.3
diff -u -r1.3 DataSourceConfig.java
--- src/share/org/apache/struts/config/DataSourceConfig.java 16 Jan 2002
17:42:40 -0000 1.3
+++ src/share/org/apache/struts/config/DataSourceConfig.java 30 Jan 2002
01:38:19 -0000
@@ -142,6 +142,9 @@
*/
public void addProperty(String name, String value) {
+ if ( name.equals("key") )
+ setKey(value) ;
+ else
properties.put(name, value);
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>