以下是struts-config.xml文件<?xml version="1.0" encoding="ISO-8859-1" ?><!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"><struts-config> <!-- ========定义Form Bean ===================--> <form-beans> <form-bean name="UsersForm" type="net.jcreate.xsgioa.Users.UsersForm" /> </form-beans><!-- ==========定义全局Forward --> <!-- <global-exceptions> <exception key="default" type="java.lang.Exception" path="failure" handler="net.jcreate.util.web.JCExceptionHandler" /> </global-exceptions> <global-forwards> <forward name="failure" path="/common/jsp/ErrorPage.jsp" contextRelative="true" /> <forward name="login" path="/dfi/jsp/User/UserLogin.jsp" contextRelative="true" /> </global-forwards>--> <!-- ==============定义ActionMapping ===================== --> <action-mappings> <action name="UsersForm" path="/UsersAction" scope="request" type="net.jcreate.xsgioa.Users.UsersAction" validate="false" parameter="command"> <forward name="list" path="/Users/UsersList.jsp" /> </action> </action-mappings><!-- ===========控制器配置,这我们通常不需要修改======================== --> <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/><!-- ==============定义消息资源========================--> <!-- <message-resources parameter="net.jcreate.dfi.ApplicationResources"/> --> <!-- =====================插件配置========================== --> <!-- ========== Tiles plugin =================== --> <!-- --> <!-- This plugin initialize Tiles definition factory. This later can takes some parameters explained here after. The plugin first read parameters from web.xml, then overload them with parameters defined here. All parameters are optional. The plugin should be declared in each struts-config file. - definitions-config: (optional) Specify configuration file names. There can be several comma separated file names (default: ?? ) - moduleAware: (optional - struts1.1) Specify if the Tiles definition factory is module aware. If true (default), there will be one factory for each Struts module. If false, there will be one common factory for all module. In this later case, it is still needed to declare one plugin per module. The factory will be initialized with parameters found in the first initialized plugin (generally the one associated with the default module). true : One factory per module. (default) false : one single shared factory for all modules - definitions-parser-validate: (optional) Specify if xml parser should validate the Tiles configuration file. true : validate. DTD should be specified in file header. (default) false : no validation
Paths found in Tiles definitions are relative to the main context. --> <!-- comment following if struts1.0.x --> <!-- <plug-in className="org.apache.struts.tiles.TilesPlugin" > <set-property property="definitions-config" value="/dfi/struts/tiles-defs.xml" /> <set-property property="moduleAware" value="true" /> <set-property property="definitions-parser-validate" value="true" /> </plug-in> --> <!-- end comment if struts1.0.x --></struts-config>
<?xml version="1.0" encoding="GB2312"?> <sql-map> <property name="main-table" value="Users"/> <property name="model-class" value="net.jcreate.xsgioa.Users.UsersForm"/> <sql-templates> <!-- ��板�� --> <sql-template name="insertUsers" > insert into users ${std.insert} </sql-template> <!-- ������ --> <sql-template name="deleteUsers" > delete from users where userId=${id} </sql-template> <!-- 淇���� --> <sql-template name="updateUsers" > update users ${std.update} where userId=${id} </sql-template> <!-- ��峰�� --> <sql-template name="getUsersId" > select * from users where userId =${id} </sql-template> <sql-template name="getListUsers" > select * from users order by userId desc </sql-template> <sql-template name="getUsers" > select * from users order by userId desc </sql-template> </sql-templates> <!-- 涓昏〃������瀛�娈� name: ������ value: 瀛�娈靛��������瀛� 濡�: select equip-sn as equipSn, name = equipSn, value = equip-sn --> <alias-fields> <!-- <alias-field name="equipId" value="id" /> --> </alias-fields> <!-- �����板��娈�:涓����涓���������ㄦ��璇����. --> <param-fields> <param-field name="startRecNum" /> <param-field name="countRecNum" /> </param-fields> <!-- 褰卞��瀛�娈� --> <map-fields> <!-- <map-field name="equipId" value="iems_equip_equip_card.id as equipId" /> --> </map-fields></sql-map>
<!--
SQLMapConfig.xml文件会引用在这定义的数据源.
--><datasources>
<datasource name="xsgioa"
factory-class="net.jcreate.jcdb.datasource.BasicDatasourceFactory">
<property name="JDBC.Driver" value="com.inet.tds.TdsDriver"/>
<property name="JDBC.ConnectionURL" value="jdbc:inetdae://localhost:1433/xsgioa?useUnicode=true&characterEncoding=GBK"/>
<property name="JDBC.ConnectionURL" value="jdbc:inetdae:hepy:1433?charset=gb2312&database=xsgioa "/>
<property name="JDBC.Username" value="sa"/>
<property name="JDBC.Password" value=""/>
<property name="Pool.MaximumActiveConnections" value="15"/>
<property name="Pool.MaximumIdleConnections" value="15"/>
<property name="Pool.MaximumWait" value="1000"/>
</datasource>
</datasources>
是不是错了~应该是
net.jcreate.jdbc.datasource.BasicDatasourceFactoryps:纯属猜测~
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"><struts-config>
<!-- ========定义Form Bean ===================-->
<form-beans>
<form-bean name="UsersForm" type="net.jcreate.xsgioa.Users.UsersForm" />
</form-beans><!-- ==========定义全局Forward -->
<!--
<global-exceptions>
<exception
key="default"
type="java.lang.Exception"
path="failure"
handler="net.jcreate.util.web.JCExceptionHandler" />
</global-exceptions> <global-forwards>
<forward name="failure" path="/common/jsp/ErrorPage.jsp" contextRelative="true" />
<forward name="login" path="/dfi/jsp/User/UserLogin.jsp" contextRelative="true" />
</global-forwards>-->
<!-- ==============定义ActionMapping ===================== -->
<action-mappings> <action name="UsersForm" path="/UsersAction" scope="request" type="net.jcreate.xsgioa.Users.UsersAction" validate="false" parameter="command">
<forward name="list" path="/Users/UsersList.jsp" />
</action>
</action-mappings><!-- ===========控制器配置,这我们通常不需要修改======================== -->
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/><!-- ==============定义消息资源========================-->
<!--
<message-resources parameter="net.jcreate.dfi.ApplicationResources"/>
-->
<!-- =====================插件配置========================== -->
<!-- ========== Tiles plugin =================== -->
<!-- -->
<!--
This plugin initialize Tiles definition factory. This later can takes some
parameters explained here after. The plugin first read parameters from web.xml, then
overload them with parameters defined here. All parameters are optional.
The plugin should be declared in each struts-config file.
- definitions-config: (optional)
Specify configuration file names. There can be several comma
separated file names (default: ?? )
- moduleAware: (optional - struts1.1)
Specify if the Tiles definition factory is module aware. If true (default),
there will be one factory for each Struts module.
If false, there will be one common factory for all module. In this later case,
it is still needed to declare one plugin per module. The factory will be
initialized with parameters found in the first initialized plugin (generally the
one associated with the default module).
true : One factory per module. (default)
false : one single shared factory for all modules
- definitions-parser-validate: (optional)
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header. (default)
false : no validation
Paths found in Tiles definitions are relative to the main context.
-->
<!-- comment following if struts1.0.x -->
<!--
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config"
value="/dfi/struts/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
-->
<!-- end comment if struts1.0.x --></struts-config>
<sql-map> <property name="main-table" value="Users"/> <property name="model-class" value="net.jcreate.xsgioa.Users.UsersForm"/> <sql-templates>
<!-- ��板�� -->
<sql-template name="insertUsers" >
insert into users
${std.insert}
</sql-template> <!-- ������ -->
<sql-template name="deleteUsers" >
delete from users
where userId=${id}
</sql-template> <!-- 淇���� -->
<sql-template name="updateUsers" >
update users
${std.update}
where userId=${id}
</sql-template> <!-- ��峰�� -->
<sql-template name="getUsersId" >
select
*
from users
where userId =${id}
</sql-template> <sql-template name="getListUsers" >
select
*
from users
order by userId desc
</sql-template> <sql-template name="getUsers" >
select
*
from users
order by userId desc
</sql-template>
</sql-templates> <!--
涓昏〃������瀛�娈�
name: ������
value: 瀛�娈靛��������瀛�
濡�: select equip-sn as equipSn,
name = equipSn, value = equip-sn
-->
<alias-fields>
<!-- <alias-field name="equipId" value="id" /> -->
</alias-fields> <!--
�����板��娈�:涓����涓���������ㄦ��璇����.
-->
<param-fields>
<param-field name="startRecNum" />
<param-field name="countRecNum" />
</param-fields> <!-- 褰卞��瀛�娈� -->
<map-fields>
<!-- <map-field name="equipId" value="iems_equip_equip_card.id as equipId" /> -->
</map-fields></sql-map>