![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
在MyElicpse中用Struts 1.3,struts-config.xml使用<data-sources>时出现错误 5
<struts-config><data-sources><data-sourcekey="sqlServer"type="org.apache.commons.dbcp...
<struts-config>
<data-sources>
<data-source key="sqlServer" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="password" value="123"/>
<set-property property="minCount" value="10"/>
<set-property property="maxCount" value="20"/>
<set-property property="username" value="sa"/>
<set-property property="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<set-property property="description" value="aic datasource SQL Server"/>
<set-property property="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=Book"/>
<set-property property="readOnly" value="false"/>
<set-property property="autoCommit" value="true"/>
</data-source>
</data-sources>
<form-beans >
<form-bean name="RegForm" type="book.struts.reg.RegForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="RegForm"
input="/reg.jsp"
name="RegForm"
path="/reg"
scope="request"
type="book.struts.reg.RegForm"
validate="false"
cancellable="true">
<forward name="regsuccess" path="/login.jsp" />
<forward name="regfail" path="/reg.jsp" />
</action>
</action-mappings>
<message-resources parameter="book.struts.ApplicationResources" />
</struts-config>
第一行<struts-config> 表示错误:The content of element type "struts-config" must match "(display-name?,description?,form-beans?,global-
exceptions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in*)".
是不是因为Struts1.3和Struts1.2设置不同,要如何设置? 展开
<data-sources>
<data-source key="sqlServer" type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="password" value="123"/>
<set-property property="minCount" value="10"/>
<set-property property="maxCount" value="20"/>
<set-property property="username" value="sa"/>
<set-property property="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<set-property property="description" value="aic datasource SQL Server"/>
<set-property property="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=Book"/>
<set-property property="readOnly" value="false"/>
<set-property property="autoCommit" value="true"/>
</data-source>
</data-sources>
<form-beans >
<form-bean name="RegForm" type="book.struts.reg.RegForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="RegForm"
input="/reg.jsp"
name="RegForm"
path="/reg"
scope="request"
type="book.struts.reg.RegForm"
validate="false"
cancellable="true">
<forward name="regsuccess" path="/login.jsp" />
<forward name="regfail" path="/reg.jsp" />
</action>
</action-mappings>
<message-resources parameter="book.struts.ApplicationResources" />
</struts-config>
第一行<struts-config> 表示错误:The content of element type "struts-config" must match "(display-name?,description?,form-beans?,global-
exceptions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in*)".
是不是因为Struts1.3和Struts1.2设置不同,要如何设置? 展开
2个回答
展开全部
<set-property property="autoCommit" value="true"/>
</data-source>
</data-sources>
<form-beans > 这里怎么 有 2个结束标签?
还有救市要注意的 就是 配置的时候 注意节点顺序 那个错误提示 已经提示的很准确了
</data-source>
</data-sources>
<form-beans > 这里怎么 有 2个结束标签?
还有救市要注意的 就是 配置的时候 注意节点顺序 那个错误提示 已经提示的很准确了
展开全部
错误提示你的是struts-config 必须与下面匹配
"(display-name?(0个或1个),description?,form-beans?,global-
exceptions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in(0个或多个))".
难道是因为你的dataSources的原因?
"(display-name?(0个或1个),description?,form-beans?,global-
exceptions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in(0个或多个))".
难道是因为你的dataSources的原因?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询