Spring的使用

web.xml 配置

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <display-name>literature</display-name>
  <filter>
    <filter-name>Set Character Encoding</filter-name>
    <filter-class>com.highcom.literature.util.SetCharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>GBK</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <servlet>
    <servlet-name>literature</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/literature-servlet.xml /WEB-INF/dataAccessContext.xml /WEB-INF/serviceContext.xml /WEB-INF/myOpusActions.xml /WEB-INF/otherOpusActions.xml /WEB-INF/sysManagerActions.xml</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>literature</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <taglib>
    <taglib-uri>pagination.tld</taglib-uri>
    <taglib-location>/WEB-INF/pagination.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>http://www.springframework.org/tags</taglib-uri>
    <taglib-location>/WEB-INF/spring.tld</taglib-location>
  </taglib>
</web-app>

literature-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
  <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <description>視圖解析器</description>
    <property name="viewClass">
      <value>org.springframework.web.servlet.view.JstlView</value>
    </property>
    <property name="prefix">
      <value>/WEB-INF/view/</value>
    </property>
    <property name="suffix">
      <value>.jsp</value>
    </property>
  </bean>
  <bean id="viewResolver2" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <description>視圖解析器2</description>
    <property name="viewClass">
      <value>org.springframework.web.servlet.view.JstlView</value>
    </property>
    <property name="prefix">
      <value>/WEB-INF/view</value>
    </property>
  </bean>
  <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    <description>文件上傳解析器</description>
  </bean>
  <bean id="defaultHandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping">
    <description>缺省請求匹配器</description>
  </bean>
  <bean id="nomalHandlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="urlMap">
      <map>
        <entry key="/front/login.do">
          <ref local="loginAction"/>
        </entry>
        <entry key="/front/logout.do">
          <ref local="logoutAction"/>
        </entry>
      </map>
    </property>
  </bean>
  <bean id="loginAction" class="com.highcom.literature.front.web.controller.LoginController">
    <property name="accountService">
      <ref bean="accountService"/>
    </property>
    <property name="successView">
      <description>正確視圖名稱</description>
      <value>/front/main</value>
    </property>
    <property name="formView">
      <description>正確視圖名稱</description>
      <value>/front/login</value>
    </property>
    <property name="errorView">
      <description>錯誤視圖名稱</description>
      <value>/front/error</value>
    </property>
  </bean>
  <bean id="logoutAction" class="com.highcom.literature.front.web.controller.LogoutController">
    <property name="viewName">
      <description>錯誤視圖名稱</description>
      <value>/front/error</value>
    </property>
  </bean>
</beans>

sysManagerActions.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
  <bean id="sysHandlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="urlMap">
      <map>
        <entry key="/test/upload.do">
          <ref local="uploadTest"/>
        </entry>
        <entry key="/sys/index.do">
          <ref local="sysIndexAction"/>
        </entry>
        <entry key="/login_sys.do">
          <ref local="sysLoginAction"/>
        </entry>
        <entry key="/index_sys.do">
          <ref local="sysWorkAction"/>
        </entry>
        <entry key="/config_sys.do">
          <ref local="sysConfigAction"/>
        </entry>
        <entry key="/top_sys.do">
          <ref local="sysTopAction"/>
        </entry>
        <entry key="/config_left_sys.do">
          <ref local="sysConfigleftAction"/>
        </entry>
        <entry key="/config_tree_sys.do">
          <ref local="sysConfigtreeAction"/>
        </entry>
         <entry key="/config_main_sys.do">
          <ref local="sysConfigmainAction"/>
        </entry>
        <!--工作流模版管理-->
        <entry key="/sys/sysWorkflow.do">
          <ref local="sysWorkflowAction"/>
        </entry>
        <entry key="/workflow/editWfTemplate.do">
          <ref local="editWfTemplateAction"/>
        </entry>
        <entry key="/workflow/addWfTemplate.do">
          <ref local="addWfTemplateAction"/>
        </entry>
        <entry key="/workflow/delWfTemplate.do">
          <ref local="delWfTemplateAction"/>
        </entry>
        <entry key="/workflow/addWfTemplateNode.do">
          <ref local="addWfTemplateNodeAction"/>
        </entry>
        <entry key="/workflow/editWfTemplateNode.do">
          <ref local="editWfTemplateNodeAction"/>
        </entry>
        <entry key="/workflow/delWfTemplateNode.do">
          <ref local="delWfTemplateNodeAction"/>
        </entry>
        <entry key="/workflow/addWfTemplateNodeMan.do">
          <ref local="addWfTemplateNodeManAction"/>
        </entry>
        <entry key="/workflow/delWfTemplateNodeMan.do">
          <ref local="delWfTemplateNodeManAction"/>
        </entry>
        <!-- 創建後臺用戶-->
        <entry key="/admin/addAdminAccount.do">
          <ref local="addAdminAccountAction"/>
        </entry>
        <!-- 出版社信息管理-->
        <entry key="/admin/Publishinfo.do">
          <ref local="publishinfo"/>
        </entry>
        <!-- 創建出版社信息-->
        <entry key="/admin/addPublishinfo.do">
          <ref local="addPublishinfo"/>
        </entry>
         <!-- 編輯出版社信息-->
         <entry key="/admin/editPublishinfo.do">
          <ref local="editPublishinfo"/>
        </entry>
         <!-- 刪除出版社信息-->
         <entry key="/admin/delPublishinfo.do">
          <ref local="delPublishinfo"/>
        </entry>
        <!-- 省份信息管理-->
         <entry key="/config/province/Provinceinfo.do">
          <ref local="provinceinfo"/>
        </entry>
        <!-- 添加省份信息-->
         <entry key="/config/province/addProvinceinfo.do">
          <ref local="addProvinceinfo"/>
        </entry>
         <!-- 編輯省份信息-->
         <entry key="/config/province/editProvinceinfo.do">
          <ref local="editProvinceinfo"/>
        </entry>
        <!-- 刪除省份信息-->
        <entry key="/config/province/delProvinceinfo.do">
          <ref local="delProvinceinfo"/>
        </entry>
         <!-- 城市信息管理-->
         <entry key="/config/city/Cityinfo.do">
          <ref local="cityinfo"/>
        </entry>
        <!-- 添加城市信息-->
         <entry key="/config/city/addCityinfo.do">
          <ref local="addcityinfo"/>
        </entry>
         <!-- 編輯城市信息-->
         <entry key="/config/city/editCityinfo.do">
          <ref local="editcityinfo"/>
        </entry>
        <!-- 刪除城市信息-->
        <entry key="/config/city/delCityinfo.do">
          <ref local="delcityinfo"/>
        </entry>
         <!-- 作家協會信息管理-->
         <entry key="/config/auun/Auuninfo.do">
          <ref local="auuninfo"/>
        </entry>
        <!-- 添加作家協會信息-->
         <entry key="/config/auun/addAuuninfo.do">
          <ref local="addauuninfo"/>
        </entry>
         <!-- 編輯作家協會信息-->
         <entry key="/config/auun/editAuuninfo.do">
          <ref local="editauuninfo"/>
        </entry>
        <!-- 刪除作家協會信息-->
        <entry key="/config/auun/delAuuninfo.do">
          <ref local="delauuninfo"/>
        </entry>
        <!-- 非原創作品分類管理-->
         <entry key="/otheropus/othersort1/Othersort1.do">
          <ref local="othersort1"/>
        </entry>
        <!-- 添加非原創作品分類信息-->
         <entry key="/otheropus/othersort1/addOthersort1.do">
          <ref local="addothersort1"/>
        </entry>
         <!-- 編輯非原創作品分類信息-->
         <entry key="/otheropus/othersort1/editOthersort1.do">
          <ref local="editothersort1"/>
        </entry>
        <!-- 刪除非原創作品分類信息-->
        <entry key="/otheropus/othersort1/delOthersort1.do">
          <ref local="delothersort1"/>
        </entry>
         <!-- 非原創作品分類2管理-->
         <entry key="/otheropus/othersort2/Othersort2.do">
          <ref local="othersort2"/>
        </entry>
        <!-- 添加非原創作品分類2信息-->
         <entry key="/otheropus/othersort2/addOthersort2.do">
          <ref local="addothersort2"/>
        </entry>
         <!-- 編輯非原創作品分類2信息-->
         <entry key="/otheropus/othersort2/editOthersort2.do">
          <ref local="editothersort2"/>
        </entry>
        <!-- 刪除非原創作品分類2信息-->
        <entry key="/otheropus/othersort2/delOthersort2.do">
          <ref local="delothersort2"/>
        </entry>
        <!-- 非原創作品管理-->
         <entry key="/otheropus/otheropus/Otheropus.do">
          <ref local="otheropus"/>
        </entry>
        <!-- 添加非原創作品-->
         <entry key="/otheropus/otheropus/addOtheropus.do">
          <ref local="addotheropus"/>
        </entry>
         <!-- 編輯非原創作品-->
         <entry key="/otheropus/otheropus/editOtheropus.do">
          <ref local="editotheropus"/>
        </entry>
        <!-- 刪除非原創作品-->
        <entry key="/otheropus/otheropus/delOtheropus.do">
          <ref local="delotheropus"/>
        </entry>
        <!-- 非原創作品管理-->
         <entry key="/otheropus/otherchapter/Otherchapter.do">
          <ref local="otherchapter"/>
        </entry>
        <!-- 添加非原創作品-->
         <entry key="/otheropus/otherchapter/addOtherchapter.do">
          <ref local="addotherchapter"/>
        </entry>
         <!-- 編輯非原創作品-->
         <entry key="/otheropus/otherchapter/editOtherchapter.do">
          <ref local="editotherchapter"/>
        </entry>
        <!-- 刪除非原創作品-->
        <entry key="/otheropus/otherchapter/delOtherchapter.do">
          <ref local="delotherchapter"/>
        </entry>
  <!-- 選擇後臺用戶-->

  <entry key="/admin/selectUser.do">
          <ref local="selectAdminAccountAction"/>
        </entry>

      </map>
    </property>
  </bean>
  <bean id="sysIndexAction" class="com.highcom.literature.back.web.controller.sys.SysIndexController">
    <description>管理員首頁</description>
  </bean>
  <bean id="sysLoginAction" class="com.highcom.literature.back.web.controller.sys.SysLoginController">
    <description>登陸首頁</description>
  </bean>
  <bean id="sysWorkAction" class="com.highcom.literature.back.web.controller.sys.SysWorkController">
    <description>後臺管理首頁</description>
  </bean>
  <bean id="sysTopAction" class="com.highcom.literature.back.web.controller.sys.SysTopController">
    <description>後臺管理top頁</description>
  </bean>
  <bean id="sysConfigAction" class="com.highcom.literature.back.web.controller.sys.SysConfigController">
    <description>後臺管理-系統管理首頁</description>
  </bean>
  <bean id="sysConfigleftAction" class="com.highcom.literature.back.web.controller.sys.SysConfigleftController">
    <description>後臺管理-系統管理left頁</description>
  </bean>
  <bean id="sysConfigtreeAction" class="com.highcom.literature.back.web.controller.sys.SysConfigtreeController">
    <description>後臺管理-系統管理tree頁</description>
  </bean>
  <bean id="sysConfigmainAction" class="com.highcom.literature.back.web.controller.sys.SysConfigmainController">
    <description>後臺管理-系統管理main頁</description>
  </bean>
  <bean id="provinceinfo" class="com.highcom.literature.sysconfig.provinceinfo.web.controller.ProvinceinfoController">
    <description>後臺管理-欄目管理-省份信息管理</description>
    <property name="adminProvinceinfoService">
      <ref bean="adminProvinceinfoService"/>
    </property>
  </bean>
  <bean id="addProvinceinfo" class="com.highcom.literature.sysconfig.provinceinfo.web.controller.AddProvinceinfoController">
    <description>後臺管理-欄目管理-省份信息添加</description>
    <property name="adminProvinceinfoService">
      <ref bean="adminProvinceinfoService"/>
    </property>
  </bean>
  <bean id="editProvinceinfo" class="com.highcom.literature.sysconfig.provinceinfo.web.controller.EditProvinceinfoController">
    <description>後臺管理-欄目管理-省份信息編輯</description>
    <property name="adminProvinceinfoService">
      <ref bean="adminProvinceinfoService"/>
    </property>
  </bean>
  <bean id="delProvinceinfo" class="com.highcom.literature.sysconfig.provinceinfo.web.controller.DelProvinceinfoController">
    <description>後臺管理-欄目管理-省份信息刪除</description>
    <property name="adminProvinceinfoService">
      <ref bean="adminProvinceinfoService"/>
    </property>
  </bean>
  <bean id="cityinfo" class="com.highcom.literature.sysconfig.cityinfo.web.controller.CityinfoController">
    <description>後臺管理-欄目管理-城市信息管理</description>
    <property name="adminCityinfoService">
      <ref bean="adminCityinfoService"/>
    </property>
  </bean>
  <bean id="addcityinfo" class="com.highcom.literature.sysconfig.cityinfo.web.controller.AddCityinfoController">
    <description>後臺管理-欄目管理-城市信息添加</description>
    <property name="adminCityinfoService">
      <ref bean="adminCityinfoService"/>
    </property>
    <property name="adminProvinceinfoService">
      <ref bean="adminProvinceinfoService"/>
    </property>
  </bean>
  <bean id="editcityinfo" class="com.highcom.literature.sysconfig.cityinfo.web.controller.EditCityinfoController">
    <description>後臺管理-欄目管理-城市信息編輯</description>
    <property name="adminCityinfoService">
      <ref bean="adminCityinfoService"/>
    </property>
    <property name="adminProvinceinfoService">
      <ref bean="adminProvinceinfoService"/>
    </property>
  </bean>
  <bean id="delcityinfo" class="com.highcom.literature.sysconfig.cityinfo.web.controller.DelCityinfoController">
    <description>後臺管理-欄目管理-城市信息刪除</description>
    <property name="adminCityinfoService">
      <ref bean="adminCityinfoService"/>
    </property>
  </bean>
  <bean id="auuninfo" class="com.highcom.literature.sysconfig.authorunioninfo.web.controller.AuuninfoController">
    <description>後臺管理-欄目管理-作家協會信息管理</description>
    <property name="adminAuuninfoService">
      <ref bean="adminAuuninfoService"/>
    </property>
  </bean>
  <bean id="addauuninfo" class="com.highcom.literature.sysconfig.authorunioninfo.web.controller.AddAuuninfoController">
    <description>後臺管理-欄目管理-作家協會信息添加</description>
    <property name="adminCityinfoService">
      <ref bean="adminCityinfoService"/>
    </property>
    <property name="adminAuuninfoService">
      <ref bean="adminAuuninfoService"/>
    </property>
  </bean>
  <bean id="editauuninfo" class="com.highcom.literature.sysconfig.authorunioninfo.web.controller.EditAuuninfoController">
    <description>後臺管理-欄目管理-作家協會信息編輯</description>
    <property name="adminCityinfoService">
      <ref bean="adminCityinfoService"/>
    </property>
    <property name="adminAuuninfoService">
      <ref bean="adminAuuninfoService"/>
    </property>
  </bean>
  <bean id="delauuninfo" class="com.highcom.literature.sysconfig.authorunioninfo.web.controller.DelAuuninfoController">
    <description>後臺管理-欄目管理-作家協會信息刪除</description>
    <property name="adminAuuninfoService">
      <ref bean="adminAuuninfoService"/>
    </property>
  </bean>
  <bean id="othersort1" class="com.highcom.literature.otheropus.othersort1.web.controller.Othersort1Controller">
    <description>非原創作品-分類管理-非原創作品分類管理</description>
    <property name="adminOthersort1Service">
      <ref bean="adminOthersort1Service"/>
    </property>
  </bean>
  <bean id="addothersort1" class="com.highcom.literature.otheropus.othersort1.web.controller.AddOthersort1Controller">
    <description>非原創作品-分類管理-非原創作品分類添加</description>
    <property name="adminOthersort1Service">
      <ref bean="adminOthersort1Service"/>
    </property>
  </bean>
  <bean id="editothersort1" class="com.highcom.literature.otheropus.othersort1.web.controller.EditOthersort1Controller">
    <description>非原創作品-分類管理-非原創作品分類編輯</description>
    <property name="adminOthersort1Service">
      <ref bean="adminOthersort1Service"/>
    </property>
  </bean>
  <bean id="delothersort1" class="com.highcom.literature.otheropus.othersort1.web.controller.DelOthersort1Controller">
    <description>非原創作品-分類管理-非原創作品分類刪除</description>
    <property name="adminOthersort1Service">
      <ref bean="adminOthersort1Service"/>
    </property>
  </bean>
  <bean id="othersort2" class="com.highcom.literature.otheropus.othersort2.web.controller.Othersort2Controller">
    <description>非原創作品-分類管理-非原創作品分類2管理</description>
    <property name="adminOthersort2Service">
      <ref bean="adminOthersort2Service"/>
    </property>
  </bean>
  <bean id="addothersort2" class="com.highcom.literature.otheropus.othersort2.web.controller.AddOthersort2Controller">
    <description>非原創作品-分類管理-非原創作品分類2添加</description>
    <property name="adminOthersort1Service">
      <ref bean="adminOthersort1Service"/>
    </property>
    <property name="adminOthersort2Service">
      <ref bean="adminOthersort2Service"/>
    </property>
  </bean>
  <bean id="editothersort2" class="com.highcom.literature.otheropus.othersort2.web.controller.EditOthersort2Controller">
    <description>非原創作品-分類管理-非原創作品分類2編輯</description>
     <property name="adminOthersort1Service">
      <ref bean="adminOthersort1Service"/>
    </property>
    <property name="adminOthersort2Service">
      <ref bean="adminOthersort2Service"/>
    </property>
  </bean>
  <bean id="delothersort2" class="com.highcom.literature.otheropus.othersort2.web.controller.DelOthersort2Controller">
    <description>非原創作品-分類管理-非原創作品分類2刪除</description>
    <property name="adminOthersort2Service">
      <ref bean="adminOthersort2Service"/>
    </property>
  </bean>
  <bean id="otheropus" class="com.highcom.literature.otheropus.otheropus.web.controller.OtheropusController">
    <description>非原創作品-作品管理-非原創作品管理</description>
    <property name="adminOtheropusService">
      <ref bean="adminOtheropusService"/>
    </property>
  </bean>
  <bean id="addotheropus" class="com.highcom.literature.otheropus.otheropus.web.controller.AddOtheropusController">
    <description>非原創作品-作品管理-非原創作品添加</description>
    <property name="adminOthersort1Service">
      <ref bean="adminOthersort1Service"/>
    </property>
    <property name="adminOthersort2Service">
      <ref bean="adminOthersort2Service"/>
    </property>
    <property name="adminOtheropusService">
      <ref bean="adminOtheropusService"/>
    </property>
  </bean>
  <bean id="editotheropus" class="com.highcom.literature.otheropus.otheropus.web.controller.EditOtheropusController">
    <description>非原創作品-作品管理-非原創作品編輯</description>
     <property name="adminOthersort1Service">
      <ref bean="adminOthersort1Service"/>
    </property>
    <property name="adminOthersort2Service">
      <ref bean="adminOthersort2Service"/>
    </property>
    <property name="adminOtheropusService">
      <ref bean="adminOtheropusService"/>
    </property>
  </bean>
  <bean id="delotheropus" class="com.highcom.literature.otheropus.otheropus.web.controller.DelOtheropusController">
    <description>非原創作品-作品管理-非原創作品刪除</description>
    <property name="adminOtheropusService">
      <ref bean="adminOtheropusService"/>
    </property>
  </bean>
  <bean id="otherchapter" class="com.highcom.literature.otheropus.otherchapter.web.controller.OtherchapterController">
    <description>非原創作品-作品管理-非原創作品章節管理</description>
    <property name="adminOtherchapterService">
      <ref bean="adminOtherchapterService"/>
    </property>
  </bean>
  <bean id="addotherchapter" class="com.highcom.literature.otheropus.otherchapter.web.controller.AddOtherchapterController">
    <description>非原創作品-作品管理-非原創作品章節添加</description>
    <property name="adminOthersort1Service">
      <ref bean="adminOthersort1Service"/>
    </property>
    <property name="adminOthersort2Service">
      <ref bean="adminOthersort2Service"/>
    </property>
    <property name="adminOtherchapterService">
      <ref bean="adminOtherchapterService"/>
    </property>
  </bean>
  <bean id="editotherchapter" class="com.highcom.literature.otheropus.otherchapter.web.controller.EditOtherchapterController">
    <description>非原創作品-作品管理-非原創作品章節編輯</description>
     <property name="adminOthersort1Service">
      <ref bean="adminOthersort1Service"/>
    </property>
    <property name="adminOthersort2Service">
      <ref bean="adminOthersort2Service"/>
    </property>
    <property name="adminOtherchapterService">
      <ref bean="adminOtherchapterService"/>
    </property>
  </bean>
  <bean id="delotherchapter" class="com.highcom.literature.otheropus.otherchapter.web.controller.DelOtherchapterController">
    <description>非原創作品-作品管理-非原創作品章節刪除</description>
    <property name="adminOtherchapterService">
      <ref bean="adminOtherchapterService"/>
    </property>
  </bean>
  <!--工作流模版管理控制器-->
  <bean id="sysWorkflowAction" class="com.highcom.literature.back.web.controller.sys.SysWorkflowController">
    <description>審批流程管理控制器</description>
    <property name="workflowService">
      <ref bean="workflowService"/>
    </property>
    <property name="accountService">
      <ref bean="accountService"/>
    </property>
  </bean>
  <bean id="addWfTemplateAction" class="com.highcom.workflow.web.controller.NewWorkflowTemplateController">
    <description>工作流模版添加控制器</description>
    <property name="workflowService">
      <ref bean="workflowService"/>
    </property>
  </bean>
  <bean id="editWfTemplateAction" class="com.highcom.workflow.web.controller.EditWorkflowTemplateController">
    <description>工作流模版編輯控制器</description>
    <property name="workflowService">
      <ref bean="workflowService"/>
    </property>
    <property name="accountService">
      <ref bean="accountService"/>
    </property>
  </bean>
  <bean id="delWfTemplateAction" class="com.highcom.workflow.web.controller.DeleteWorkflowTemplateController">
    <description>工作流模版刪除控制器</description>
    <property name="workflowService">
      <ref bean="workflowService"/>
    </property>
    <property name="accountService">
      <ref bean="accountService"/>
    </property>
  </bean>
  <bean id="addWfTemplateNodeAction" class="com.highcom.workflow.web.controller.NewWorkflowTNodeController">
    <description>工作流模版結點添加控制器</description>
    <property name="workflowService">
      <ref bean="workflowService"/>
    </property>
    <property name="accountService">
      <ref bean="accountService"/>
    </property>
  </bean>
  <bean id="editWfTemplateNodeAction" class="com.highcom.workflow.web.controller.EditWorkflowTNodeController">
    <description>工作流模版結點編輯控制器</description>
    <property name="workflowService">
      <ref bean="workflowService"/>
    </property>
    <property name="accountService">
      <ref bean="accountService"/>
    </property>
  </bean>
  <bean id="delWfTemplateNodeAction" class="com.highcom.workflow.web.controller.DeleteWorkflowTNodeController">
    <description>工作流模版結點刪除控制器</description>
    <property name="workflowService">
      <ref bean="workflowService"/>
    </property>
    <property name="accountService">
      <ref bean="accountService"/>
    </property>
  </bean>
  <bean id="addWfTemplateNodeManAction" class="com.highcom.workflow.web.controller.NewWorkflowTNodeManController">
    <description>工作流模版結點人員添加控制器</description>
    <property name="workflowService">
      <ref bean="workflowService"/>
    </property>
    <property name="accountService">
      <ref bean="accountService"/>
    </property>
  </bean>
  <bean id="delWfTemplateNodeManAction" class="com.highcom.workflow.web.controller.DeleteWorkflowTNodeManController">
    <description>工作流模版結點人員刪除控制器</description>
    <property name="workflowService">
      <ref bean="workflowService"/>
    </property>
    <property name="accountService">
      <ref bean="accountService"/>
    </property>
  </bean>
  <bean id="addAdminAccountAction" class="com.highcom.literature.account.web.controller.AddAdminAccountController">
    <description>創建後臺用戶控制器</description>
    <property name="roleService">
      <ref bean="roleService"/>
    </property>
    <property name="adminAccountService">
      <ref bean="adminAccountService"/>
    </property>
  </bean>
  <!--出版關注-->
  <bean id="publishinfo" class="com.highcom.literature.publishinfo.web.controller.PublishController">
    <description>出版社信息控制器</description>
    <property name="adminPublishinfoService">
      <ref bean="adminPublishinfoService"/>
    </property>
  </bean>
  <bean id="addPublishinfo" class="com.highcom.literature.publishinfo.web.controller.AddPublishController">
    <description>創建出版社信息控制器</description>
    <property name="adminPublishinfoService">
      <ref bean="adminPublishinfoService"/>
    </property>
  </bean>
  <bean id="editPublishinfo" class="com.highcom.literature.publishinfo.web.controller.EditPublishController">
    <description>編輯出版社信息控制器</description>
    <property name="adminPublishinfoService">
      <ref bean="adminPublishinfoService"/>
    </property>
  </bean>
  <bean id="delPublishinfo" class="com.highcom.literature.publishinfo.web.controller.DelPublishController">
    <description>刪除出版社信息控制器</description>
    <property name="adminPublishinfoService">
      <ref bean="adminPublishinfoService"/>
    </property>
  </bean>
   <!--選擇後臺用戶-->
    <bean id="selectAdminAccountAction" class="com.highcom.literature.account.web.controller.UserSelectController">
    <description>選擇後臺用戶控制器</description>
    <property name="roleService">
      <ref bean="roleService"/>
    </property>
    <property name="adminAccountService">
      <ref bean="adminAccountService"/>
    </property>
  </bean>

  <bean id="uploadTest" class="com.highcom.literature.uploadtest.UploadTest">
    <description>測試文件上傳</description>
  </bean>

</beans>

dataAccessContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
  <bean id="dataSource"
    class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName">
      <value>oracle.jdbc.driver.OracleDriver</value>
    </property>
    <property name="url">
      <value>jdbc:oracle:thin:@192.168.255.15:1521:highcom</value>
    </property>
    <property name="username">
      <value>literature</value>
    </property>
    <property name="password">
      <value>1234</value>
    </property>
  </bean>

<!--
  <bean id="dataSource"
    class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName">
      <value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
    </property>
    <property name="url">
      <value>jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=literature</value>
    </property>
    <property name="username">
      <value>sa</value>
    </property>
    <property name="password">
      <value>sa</value>
    </property>
  </bean>
   -->
   <!--
  <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName"><value>OracleDS</value></property>
  </bean>
-->
  <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
  </bean>
  <bean id="baseTransactionProxy" lazy-init="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager">
      <ref local="transactionManager"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <!--Dao實現-->
  <bean id="seqDaoImpl" class="com.highcom.seqgen.dao.jdbc.SequenceDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
  </bean>
  <bean id="workflowDaoImpl" class="com.highcom.workflow.dao.jdbc.WorkflowDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
  <bean id="accountDaoImpl" class="com.highcom.literature.account.dao.jdbc.AccountDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
    <bean id="adminAccountDaoImpl" class="com.highcom.literature.account.dao.jdbc.AdminAccountDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
   <bean id="adminPublishDaoImpl" class="com.highcom.literature.publishinfo.dao.jdbc.AdminPublishDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
  <bean id="adminProvinceinfoDaoImpl" class="com.highcom.literature.sysconfig.provinceinfo.dao.jdbc.AdminProvinceinfoDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
  <bean id="adminCityinfoDaoJdbcImpl" class="com.highcom.literature.sysconfig.cityinfo.dao.jdbc.AdminCityinfoDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
  <bean id="adminAuuninfoDaoJdbcImpl" class="com.highcom.literature.sysconfig.authorunioninfo.dao.jdbc.AdminAuuninfoDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
  <bean id="adminOthersort1DaoJdbcImpl" class="com.highcom.literature.otheropus.othersort1.dao.jdbc.AdminOthersort1DaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
  <bean id="adminOthersort2DaoJdbcImpl" class="com.highcom.literature.otheropus.othersort2.dao.jdbc.AdminOthersort2DaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
  <bean id="adminOtheropusDaoJdbcImpl" class="com.highcom.literature.otheropus.otheropus.dao.jdbc.AdminOtheropusDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
  <bean id="adminOtherchapterDaoJdbcImpl" class="com.highcom.literature.otheropus.otherchapter.dao.jdbc.AdminOtherchapterDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
    <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
  <bean id="opusDaoImpl" class="com.highcom.literature.myopus.dao.jdbc.OpusDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
     <property name="sequenceService">
      <ref bean="sequenceService"/>
    </property>
  </bean>
  <bean id="sortDaoImpl" class="com.highcom.literature.myopus.dao.jdbc.SortDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
  </bean>
   <bean id="roleDaoImpl" class="com.highcom.literature.account.dao.jdbc.RoleDaoJdbcImpl">
    <property name="dataSource">
      <ref local="dataSource"/>
    </property>
  </bean>
  <!--Dao事務封裝-->
  <bean id="seqDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="seqDaoImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="set*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="workflowDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="workflowDaoImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="set*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="accountDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="accountDaoImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
    <bean id="adminAccountDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="adminAccountDaoImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="adminPublishDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="adminPublishDaoImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="adminProvinceinfoDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="adminProvinceinfoDaoImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="adminCityinfoDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="adminCityinfoDaoJdbcImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="adminAuuninfoDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="adminAuuninfoDaoJdbcImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="adminOthersort1Dao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="adminOthersort1DaoJdbcImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="adminOthersort2Dao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="adminOthersort2DaoJdbcImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="adminOtheropusDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="adminOtheropusDaoJdbcImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="adminOtherchapterDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="adminOtherchapterDaoJdbcImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="opusDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="opusDaoImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="set*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="sortDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="sortDaoImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
        <prop key="add*">PROPAGATION_REQUIRED</prop>
      </props>
    </property>
  </bean>
  <bean id="roleDao" parent="baseTransactionProxy">
    <property name="target">
      <ref bean="roleDaoImpl"/>
    </property>
    <property name="transactionAttributes">
      <props>
        <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
      </props>
    </property>
  </bean>
</beans>

下面我就粘貼上幾個有代表性的類

/* Generated by Together */

package com.highcom.literature.account;

import com.highcom.literature.account.domain.Account;

public interface AccountService {
    /**
     * 添加一個賬號
     * @throws UserExistException
     */
    void addAccount(Account account) throws UserExistException;

    /**
     * 刪除一個賬號,假刪除。
     */
    void deleteAccount(String username);
    void deleteAccount(int id);

    /**
     * 修改賬號
     */
    void modifyAccount(Account account);

    /**
     * 顯示所有賬號
     * @return Account[]
     */
    Account[] getAccount();

    /**
     * 取得指定賬號 根據用戶名
     * @param accountID String
     * @return Account
     */
    Account getAccount(String username);
    /**
     * 取得指定賬號 根據用戶id
     * @param accountID
     * @return
     */
    Account getAccount(int accountID);
    /**
     * 禁用賬號
     * @param accountID String
     */
    void setDisavailable(String accountID);
    /**
     * 驗證用戶名密碼是否正確
     * @param username String
     * @param password String
     * @return int 0 通過,1 用戶禁用,2 用戶名或者密碼錯誤
     */
    int authorize(String username,String password);
}
/* Generated by Together */

package com.highcom.literature.account;

import com.highcom.literature.account.dao.*;
import com.highcom.literature.account.domain.*;
import com.highcom.workflow.*;
import com.highcom.workflow.domain.WorkflowTemplate;

public class AccountServiceImpl implements AccountService {
    private AccountDao accountDao;
    private WorkflowService workflowService;
    /**
     * 添加一個賬號
     * @throws UserExistException
     */
    public void addAccount(Account account) throws
            UserExistException {
        WorkflowTemplate workflowT = workflowService.getDefaultWorkflow();
         //設置默認的工作流模板
        account.setAssess_level(Integer.parseInt(workflowT.getId()));
        accountDao.addAccount(account);
    }

    /**
     * 刪除一個賬號,假刪除。
     */
    public void deleteAccount(String username) {
        accountDao.deleteAccount(username);
    }
    public void deleteAccount(int id){
     accountDao.deleteAccount(id);
    }

    /**
     * 修改賬號
     */
    public void modifyAccount(Account account) {
        accountDao.modifyAccount(account);
    }

    /**
     * 顯示所有賬號
     * @return Account[]
     */
    public Account[] getAccount() {
        return accountDao.getAccount();
    }

    /**
     * 取得指定賬號
     * @param accountID String
     * @return Account
     */
    public Account getAccount(String username) {
        return accountDao.getAccount(username);
    }
    public Account getAccount(int accountID) {
        return accountDao.getAccount(accountID);
    }

    /**
     * 禁用賬號
     * @param accountID String
     */
    public void setDisavailable(String accountID) {}

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    public void setWorkflowService(WorkflowService workflowService) {
        this.workflowService = workflowService;
    }

    public AccountDao getAccountDao() {
        return accountDao;
    }

    public WorkflowService getWorkflowService() {
        return workflowService;
    }

    /**
     * 驗證用戶名密碼是否正確
     * @param username String
     * @param password String
     * @return int 0 通過,1 用戶禁用,2 用戶名或者密碼錯誤
     */
    public int authorize(String username, String password) {
        return accountDao.authorize(username, password);
    }
}
/* Generated by Together */

package com.highcom.literature.account.dao;

import com.highcom.literature.account.UserExistException;
import com.highcom.literature.account.domain.Account;

public interface AccountDao {
    /**
     * 添加一個賬號
     * @throws UserExistException
     */
    void addAccount(Account account) throws UserExistException;

    /**
     * 刪除一個賬號,假刪除。
     */
    void deleteAccount(String username);
    void deleteAccount(int id);
    /**
     * 修改賬號
     */
    void modifyAccount(Account account);

    /**
     * 顯示所有賬號
     * @return Account[]
     */
    Account[] getAccount();

    /**
     * 取得指定賬號
     * @param accountID String
     * @return Account
     */
    Account getAccount(String username);
    Account getAccount(int accountID);
    /**
     * 禁用賬號
     * @param accountID String
     */
    void setDisavailable(String accountID);
    /**
     * 驗證用戶名密碼是否正確
     * @param username String
     * @param password String
     * @return int 0 通過,1 用戶禁用,2 用戶名或者密碼錯誤
     */
    int authorize(String username,String password);
}
/* Generated by Together */

package com.highcom.literature.account.dao.jdbc;

import com.highcom.literature.account.UserExistException;
import com.highcom.literature.account.domain.Account;
import com.highcom.literature.account.dao.AccountDao;
import org.springframework.jdbc.core.support.*;
import java.sql.Types;
import com.highcom.seqgen.SequenceService;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.dao.DataAccessException;
import java.sql.ResultSet;
import java.sql.SQLException;

/** @todo 以下方法的jdbc操作沒有完成 */
public class AccountDaoJdbcImpl extends JdbcDaoSupport implements AccountDao {
 private SequenceService sequenceService;

 /**
  * 添加一個賬號
  *
  * @throws UserExistException
  */
 public void addAccount(Account account) throws UserExistException {
  Object obj = this.getJdbcTemplate().query(
    "select username from t_author_account where username=?",
    new Object[] { new String(account.getUsername()) },
    new int[] { Types.VARCHAR }, new ResultSetExtractor() {
     public Object extractData(ResultSet rs)
       throws SQLException, DataAccessException {
      if (rs.next()) {
       Account temp = new Account();
       temp.setUsername(rs.getString("username"));
       return temp;
      }
      return null;
     }
    });
  if (obj != null)
   throw new UserExistException("該用戶名已經存在.");
  //獲取id
  String id = sequenceService.getValue("com.highcom.literature.account");
  //取當前的系統時間
  java.sql.Timestamp date = new java.sql.Timestamp(System
    .currentTimeMillis());
  account.setJoin_date(date);
  this
    .getJdbcTemplate()
    .update(
      "insert into t_author_account (account_id,username,password,name,sex,email,"
        + "birthday,province,city,confraternity,address,postcode,phone,fax,mobile,"
        + "photo,overview,join_date,assess_level) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
      new Object[] { new Integer(id),

      account.getUsername(), account.getPassword(),
        account.getName(),
        new Integer(account.getSex()),
        account.getEmail(), account.getBirthday(),
        account.getProvince(), account.getCity(),
        account.getConfraternity(),
        account.getAddress(), account.getPostcode(),
        account.getPhone(), account.getFax(),
        account.getMobile(), account.getPhone(),
        account.getOverview(), account.getJoin_date(),
        new Integer(account.getAssess_level()) },
      new int[] { Types.INTEGER, Types.VARCHAR,
        Types.VARCHAR, Types.VARCHAR, Types.INTEGER,
        Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
        Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
        Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
        Types.VARCHAR, Types.VARCHAR, Types.VARCHAR,
        Types.TIMESTAMP, Types.INTEGER });
 }

 /**
  * 刪除一個賬號,假刪除。
  */
 public void deleteAccount(String username) {
 }

 public void deleteAccount(int id) {
 }

 /**
  * 修改賬號
  */
 public void modifyAccount(Account account) {
 }

 /**
  * 顯示所有賬號
  *
  * @return Account[]
  */
 public Account[] getAccount() {
  return null;
 }

 /**
  * 取得指定賬號
  *
  * @param accountID
  *            String
  * @return Account
  */
 public Account getAccount(String username) {
  Object obj = this.getJdbcTemplate().query(
    "select * from t_author_account where username=?",
    new Object[] { username }, new int[] { Types.VARCHAR },
    new ResultSetExtractor() {
     public Object extractData(ResultSet rs)
       throws SQLException, DataAccessException {
      if (rs.next()) {
       Account temp = new Account();
       temp.setAccount_id(rs.getString("account_id"));
       temp.setUsername(rs.getString("username"));
       temp.setAssess_level(rs.getInt("assess_level"));
       return temp;
      }
      return null;
     }
    });
  return (Account) obj;
 }

 public Account getAccount(int accountID) {
  Object obj = this.getJdbcTemplate().query(
    "select * from t_author_account where account_id=?",
    new Object[] { new String(accountID + "") },
    new int[] { Types.INTEGER }, new ResultSetExtractor() {
     public Object extractData(ResultSet rs)
       throws SQLException, DataAccessException {
      if (rs.next()) {
       Account temp = new Account();
       temp.setAccount_id(rs.getString("account_id"));
       temp.setUsername(rs.getString("username"));
       temp.setAssess_level(rs.getInt("assess_level"));
       return temp;
      }
      return null;
     }
    });
  return (Account) obj;
 }

 /**
  * 禁用賬號
  *
  * @param accountID
  *            String
  */
 public void setDisavailable(String accountID) {
 }

 /**
  * 驗證用戶名密碼是否正確
  *
  * @param username
  *            String
  * @param password
  *            String
  * @return int 0 通過,1 用戶禁用,2 用戶名或者密碼錯誤
  */
 public int authorize(String username, String password) {
  Object obj = this
    .getJdbcTemplate()
    .query(
      "select username from t_author_account where username=? and password =? ",
      new Object[] { username, password },
      new int[] { Types.VARCHAR, Types.VARCHAR },
      new ResultSetExtractor() {
       public Object extractData(ResultSet rs)
         throws SQLException, DataAccessException {
        if (rs.next()) {
         Account temp = new Account();
         //       temp.setAccount_id(rs.getString("account_id"));
         //       temp.setUsername(rs.getString("username"));
         //       temp.setAssess_level(rs.getInt("assess_level"));
         return temp;
        }
        return null;
       }
      });
  if (obj == null)
   return 2;
  else
   return 0;
 }

 public void setSequenceService(SequenceService sequenceService) {
  this.sequenceService = sequenceService;
 }

 public SequenceService getSequenceService() {
  return sequenceService;
 }

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章