问题如下:
我的struts-config.xml在没有加datasources的时候一切运行正常,可是家了他后见出现下面的错误了:
type Status report
message Servlet actionServlet is not available
description The requested resource (Servlet actionServlet is not available) is not available.
文件配置:
<struts-config>
<data-sources>
<data-source key= "SQLServerDB " type= "org.apache.commons.dbcp.BasicDataSource ">
<set-property property= "driverClassName " value= "com.micorsoft.jdbc.sqlserver.SQLServerDriver "/>
<set-property property= "url " value= "jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=police; "/>
<set-property property= "maxActive " value= "5 "/>
<set-property property= "username " value= "sa "/>
<set-property property= "password " value= " "/>
</data-source>
</data-sources>
<form-beans>
<form-bean name= "user " type= "com.lcs.UserForm " />
</form-beans>
<global-forwards>
<forward name= "failed " path= "/Login.jsp " />
<forward name= "s " path= "/Right.jsp " />
</global-forwards>
<action-mappings>
<action path= "/login " type= "com.lcs.LoginAction " name= "user "
scope= "request " input= "/login.jsp " />
<action path= "/hello " forward= "/Hello.jsp "> </action>
</action-mappings>
<message-resources parameter= "com.lcs.MyResource "/>
</struts-config>
请高手指教,谢谢
------解决方案--------------------
lz试试下面的:
<data-sources>
<data-source key= "SQLServerDB ">
<set-property property= "password " value= " " />
<set-property property= "minCount " value= "1 " />
<set-property property= "maxCount " value= "3 " />
<set-property property= "user " value= "sa " />
<set-property property= "driverClass " value= "com.microsoft.jdbc.sqlserver.SQLServerDriver " />
<set-property property= "url " value= "jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=police " />
<set-property property= "readOnly " value= "false " />
<set-property property= "autoCommit " value= "true " />
<set-property property= "loginTimeout " value= "3 " />