1、默认配置文件名jasmine-config.xml,放在WEB-INFO/CLASSES/目录下,也可以指定文件名和路径,样例如下:
<?
xml
version
=
"1.0"
encoding
=
"gb2312"
?>
<
jasmine-config
xmlns:xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
>
<
action-mappings
>
<
action
path
=
"/*/list*"
name
=
"list{2}Action"
className
=
"juan.business.{1}.Get{2}ListAction"
>
<
forward
name
=
"fail"
redirect
=
"false"
contextRelative
=
"true"
path
=
"/{1}/err{2}.jsp"
/>
<
forward
name
=
"success"
redirect
=
"false"
contextRelative
=
"true"
path
=
"/{1}/list{2}.jsp"
/>
</
action
>
<
action
path
=
"/*/edit*"
name
=
"edit{2}Action"
className
=
"juan.business.general.GetGeneralEditAction"
>
<
forward
name
=
"fail"
redirect
=
"false"
contextRelative
=
"true"
path
=
"/{1}/err{2}.jsp"
/>
<
forward
name
=
"success"
redirect
=
"false"
contextRelative
=
"true"
path
=
"/{1}/edit{2}.jsp"
/>
</
action
>
<
action
path
=
"/*/save*"
name
=
"save{2}Action"
className
=
"juan.business.general.SaveGeneralAction"
>
<
forward
name
=
"fail"
redirect
=
"false"
contextRelative
=
"true"
path
=
"/{1}/err{2}.jsp"
/>
<
forward
name
=
"success"
redirect
=
"false"
contextRelative
=
"true"
path
=
"/{1}/list{2}.do"
/>
</
action
>
<
action
path
=
"/*/delete*"
name
=
"delete{2}Action"
className
=
"juan.business.general.DeleteGeneralAction"
>
<
forward
name
=
"fail"
redirect
=
"false"
contextRelative
=
"true"
path
=
"/{1}/err{2}.jsp"
/>
<
forward
name
=
"success"
redirect
=
"false"
contextRelative
=
"true"
path
=
"/{1}/list{2}.do"
/>
</
action
>
</
action-mappings
>
<
event-mappings
>
<
action-event
actionname
=
"delete_{1}Action"
>
<
event
order
=
"0"
invokeType
=
"before"
className
=
"juan.business.operation.{1}Event"
/>
<
event
order
=
"1"
invokeType
=
"before"
className
=
"juan.business.operation.{1}OrderEvent"
/>
<
event
order
=
"0"
invokeType
=
"after"
className
=
"juan.business.operation.{1}Event"
/>
</
action-event
>
<
action-event
actionname
=
"editTopicAction"
>
<
event
order
=
"0"
invokeType
=
"after"
className
=
"juan.demo.event.{2}Event"
/>
</
action-event
>
</
event-mappings
>
<!--transaction className="juan.transaction.JTransaction"/-->
</
jasmine-config
>
2.web配置文件(web.xml)
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
web-app
id
=
"WebApp_ID"
version
=
"2.4"
xmlns
=
"http://java.sun.com/xml/ns/j2ee"
xmlns:xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation
=
"http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>
<
display-name
>
RoseForJ
</
display-name
>
<
welcome-file-list
>
<
welcome-file
>
index.jsp
</
welcome-file
>
<
welcome-file
>
default.jsp
</
welcome-file
>
</
welcome-file-list
>
<
resource-ref
>
<
res-ref-name
>
jdbc/defaultdb
</
res-ref-name
>
<
res-type
>
javax.sql.DataSource
</
res-type
>
<
res-auth
>
Container
</
res-auth
>
<
res-sharing-scope
>
Shareable
</
res-sharing-scope
>
</
resource-ref
>
<
filter
>
<
filter-name
>
CharacterEncoding
</
filter-name
>
<
filter-class
>
juan.web.filter.EncodingFilter
</
filter-class
>
<
init-param
>
<
param-name
>
encoding
</
param-name
>
<
param-value
>
GB2312
</
param-value
>
</
init-param
>
<
init-param
>
<
param-name
>
ignore
</
param-name
>
<
param-value
>
true
</
param-value
>
</
init-param
>
</
filter
>
<
filter-mapping
>
<
filter-name
>
CharacterEncoding
</
filter-name
>
<
url-pattern
>
/*
</
url-pattern
>
</
filter-mapping
>
<
servlet
>
<
servlet-name
>
ActionServlet
</
servlet-name
>
<
servlet-class
>
juan.framework.ActionServlet
</
servlet-class
>
<!—
可选,默认在
WEB
-
INFO
/
CLASSES
/目录下,也可以通过以下配置指定位置
<
init-param
>
<
param-name
>
resource.config.path
</
param-name
>
<
param-value
>
d://workspace//RoseForJ//src//jasmine-config.xml
</
param-value
>
</
init-param
>
-->
<!--
可选,默认为
tomcat
下数据链接池
jdbc/defaultdb
<
init-param
>
<
param-name
>
default.jndi
</
param-name
>
<
param-value
>
java:comp/env/jdbc/defaultdb
</
param-value
>
</
init-param
>
-->
<
load-on-startup
>
1
</
load-on-startup
>
</
servlet
>
<
servlet-mapping
>
<
servlet-name
>
ActionServlet
</
servlet-name
>
<
url-pattern
>
*.do
</
url-pattern
>
</
servlet-mapping
>
<
jsp-config
>
<
taglib
>
<
taglib-uri
>
veltag
</
taglib-uri
>
<
taglib-location
>
/WEB-INF/veltag.tld
</
taglib-location
>
</
taglib
>
</
jsp-config
>
</
web-app
>