使用Webwork2 作为MVC的要注意的配置项。
1、web.xml
<
filter
>
<
filter-name
>
webwork
</
filter-name
>
<
filter-class
>
com.opensymphony.webwork.dispatcher.FilterDispatcher
</
filter-class
>
</
filter
>

<
filter-mapping
>
<
filter-name
>
webwork
</
filter-name
>
<
url-pattern
>
/*
</
url-pattern
>
</
filter-mapping
>
2、xwork.xml
关于default-action-ref--如果你在xwork.xml里面配置了default-action-ref,那么当xwork中没有找到对应的action时,默认就会调用default-action-ref指定的action。但是要注意,一般一个package内配置一个,如果配置多个,就无法预测结果了。
xwork配置样例
<!
DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.1.1//EN" "http://www.opensymphony.com/xwork/xwork-1.1.1.dtd"
>

<
xwork
>
<
include
file
="webwork-default.xml"
/>

<
package
name
="default"
extends
="webwork-default"
>

<
default-action-ref
name
="home"
/>

<
action
name
="home"
class
="example.HomeAction"
>
<
result
>
/WEB-INF/pages/home.jsp
</
result
>
</
action
>

</
package
>
</
xwork
>
注意:上面的result的name属性被省略时,WebWork会认为它是"SUCCESS"。
3、webwork.properties
430

被折叠的 条评论
为什么被折叠?



