You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Cooper <ma...@apache.org> on 2003/12/04 01:27:26 UTC
Re: Database
"Dynamic Systems" <li...@dynsystems.com.br> wrote in message
news:004601c3ba02$0d211a40$1ed1b3c8@pc...
> Another problem. I've setup a database connection in the
struts-config.xml.
> Is the <data-sources> position correct?
No.
http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd
--
Martin Cooper
> I'm getting the following error:
>
> Cannot find ActionMappings or ActionFormBeans collection
>
> Take a look at the file:
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <!DOCTYPE struts-config PUBLIC
> "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
> "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
>
> <struts-config>
>
> <form-beans>
> <!-- Struts Example form bean -->
> <form-bean name="StrutsInputFormBean"
> type="org.struts.example.StrutsInputForm" />
> <form-bean name="StrutsDisplayFormBean"
> type="org.struts.example.StrutsDisplayForm" />
> </form-beans>
>
> <global-forwards>
> <forward name="Menu" path="/index.html"/>
> </global-forwards>
>
> <action-mappings>
>
> <!-- StrutsExample -->
> <action path="/StrutsInputPath"
> type="org.struts.example.StrutsInputAction"
> name="StrutsInputFormBean"
> scope="request" input="/PgInput.jsp">
> <forward name="Next" path="/PgDisplay.jsp" />
> </action>
>
> <action path="/StrutsDisplayPath"
> type="org.struts.example.StrutsDisplayAction"
> name="StrutsDisplayFormBean"
> scope="request" input="/PgDisplay.jsp" >
> </action>
>
> </action-mappings>
>
> <data-sources>
> <!-- configuration for commons BasicDataSource -->
> <data-source type="org.apache.commons.dbcp.BasicDataSource">
> <set-property property="driverClassName" value="com.mysql.jdbc.Driver"
> />
> <set-property
> property="key"
> value="databasename" />
> <set-property
> property="url"
> value="jdbc:mysql://localhost/databasename" />
> <set-property
> property="username"
> value="userxxx" />
> <set-property
> property="password"
> value="passxxx" />
> <set-property
> property="maxActive"
> value="10" />
> <set-property
> property="maxWait"
> value="5000" />
> <set-property
> property="defaultAutoCommit"
> value="false" />
> <set-property
> property="defaultReadOnly"
> value="false" />
> <set-property
> property="validationQuery"
> value="SELECT COUNT(*) FROM TEST" />
> </data-source>
> </data-sources>
>
> </struts-config>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org