ssh2+jbpm3集成开发示例(三)
上面示例的代码已基本完成。现在这开始编写配置文件了。主要有beanx.xml,struts.xml,web.xml这几个文件 。
1.beans.xml【spring核心配置文件】
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
?xmlns:tx="http://www.springframework.org/schema/tx"
?xmlns:aop="http://www.springframework.org/schema/aop"
?xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
??????http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
??????http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
?<!-- 配置session工厂 -->
?<bean id="sessionFactory"
??/>
??</property>
?</bean>
?<!-- annotation风格的声明式事务管理 -->
?<tx:annotation-driven transaction-manager="txManager" proxy-target-/>
?<bean id="JbpmConfiguration"
??value="classpath:jbpm.cfg.xml" />
??<property name="createSchema" value="false" />
??<property name="sessionFactory">
???<ref local="sessionFactory" />
??</property>
?</bean>
?<!-- jBPM template -->
?<bean id="JbpmTemplate"
??ref="JbpmConfiguration" />
?</bean>
?
?
?<!-- 配置jbpmdao -->
?<bean id="monthJbpmDao" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
??? "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
??? "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
?<include file="struts-default.xml" />
?<constant name="struts.multipart.saveDir" value="c:\tmp"></constant>
?<constant name="struts.multipart.maxSize" value="4097152"></constant>
?<package name="struts-default-self" extends="struts-default">
?
??<global-results>
???<result name="error">/error.jsp</result>
??</global-results>
??<global-exception-mappings>
???<exception-mapping result="error"
????exception="java.lang.Exception">
???</exception-mapping>
??</global-exception-mappings>
??
??<action name="month"? encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
?xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
?http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
?<context-param>
??<param-name>contextConfigLocation</param-name>
??<param-value>classpath:bean*.xml</param-value>
?</context-param>
?<listener>
??<listener-class>
???org.springframework.web.context.ContextLoaderListener
??</listener-class>
?</listener>
?<filter>
??<filter-name>struts2</filter-name>
??<filter-class>
???org.apache.struts2.dispatcher.FilterDispatcher
??</filter-class>
?</filter>
?<filter-mapping>
??<filter-name>struts2</filter-name>
??<url-pattern>/*</url-pattern>
?</filter-mapping>
?
?<servlet>
??<servlet-name>ProcessImageServlet</servlet-name>
??<servlet-class>
???org.jbpm.webapp.servlet.ProcessImageServlet
??</servlet-class>
?</servlet>
?<servlet-mapping>
??<servlet-name>ProcessImageServlet</servlet-name>
??<url-pattern>/processimage</url-pattern>
?</servlet-mapping>
??<welcome-file-list>
??<welcome-file>index.jsp</welcome-file>
?</welcome-file-list>
</web-app>
配置完毕!接下来的工作便是测试了,这个工作也很重要。休息下先...