坚持学习,每天进步一些
第一天
BlogJava
首页
新随笔
新文章
联系
聚合
管理
posts - 0,comments - 7,trackbacks - 0
<
2025年5月
>
日
一
二
三
四
五
六
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
留言簿
(1)
给我留言
查看公开留言
查看私人留言
文章分类
AJAX(1)
DB(1)
Hibernate
Java(4)
OpenSource(11)
Spring(2)
Web
Web Service(5)
WebWork
文章档案
2007年3月 (4)
2007年1月 (9)
2006年12月 (1)
2006年10月 (1)
2006年9月 (1)
2006年7月 (4)
2006年6月 (4)
Favor
和讯Blog
和讯朋友
我的大四生活 [转]
技术网站
CVS使用手册
兔八哥的blog
开源ERP论坛
开源网站
满江红
相关技术文档
网友Blog
monkey
老王
搜索
最新评论
1. re: Apache SOAP介绍1 [转]fdf[未登录]
df
--df
2. re: Apache SOAP介绍1 [转]
请问你有没有使用AXIS包的方法?
--accless
3. re: Lucene-2.0学习文档-4[转]
同时也支持一下你啊
--qixoo.com 企讯网--5000万企业速查|求职参考|企业点评|从业者与企业沟通的桥梁
4. re: Lucene-2.0学习文档-4[转]
我的网站就是用lucene做的,可以交流一下
--qixoo.com 企讯网--5000万企业速查|求职参考|企业点评|从业者与企业的桥梁
5. re: Lucene-2.0学习文档-4[转]
评论内容较长,点击标题查看
--qixoo.com 企讯网--5000万企业速查|求职参考|企业点评|企业从业者与企业的桥梁
webWork整合Spring例子
代码
<?
xml
version
=
"1.0"
encoding
=
"ISO-8859-1"
?>
<!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
>
WW
</
display-name
>
<!-- START SNIPPET: example -->
<
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
>
<
listener
>
<
listener-class
>
org.springframework.web.context.ContextLoaderListener
</
listener-class
>
</
listener
>
<
listener
>
<
listener-class
>
com.atlassian.xwork.ext.ResolverSetupServletContextListener
</
listener-class
>
</
listener
>
<
servlet
>
<
servlet-name
>
JspSupportServlet
</
servlet-name
>
<
servlet-class
>
com.opensymphony.webwork.views.JspSupportServlet
</
servlet-class
>
<
load-on-startup
>
1
</
load-on-startup
>
</
servlet
>
<!--
<
servlet
>
<
servlet-name
>
action
</
servlet-name
>
<
servlet-class
>
com.opensymphony.webwork.dispatcher.ServletDispatcher
</
servlet-class
>
</
servlet
>
<
servlet-mapping
>
<
servlet-name
>
action
</
servlet-name
>
<
url-pattern
>
*.do
</
url-pattern
>
</
servlet-mapping
>
--
>
<
welcome-file-list
>
<
welcome-file
>
index.jsp
</
welcome-file
>
<
welcome-file
>
default.jsp
</
welcome-file
>
<
welcome-file
>
index.html
</
welcome-file
>
</
welcome-file-list
>
<!-- START SNIPPET: taglib -->
<!--
This typically isn't required, as the taglib is included in webwork.jar.
If you really need a taglib configuration within web.xml, copy webwork/src/java/META-INF/taglib.tld
to the WEB-INF directory as webwork.tld.
--
>
<
taglib
>
<
taglib-uri
>
webwork
</
taglib-uri
>
<
taglib-location
>
/WEB-INF/lib/webwork-2.2.2.jar
</
taglib-location
>
</
taglib
>
</
web-app
>
直接从例子程序里面考出来的,applicationContext.xml
代码
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"
>
<
beans
default-autowire
=
"autodetect"
>
<
bean
id
=
"helloBean"
class
=
"com.ww.test.HelloBean"
singleton
=
"true"
/>
<!-- add your spring beans here -->
</
beans
>
xworl.xml如下:
代码
<!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"
externalReferenceResolver
=
"com.opensymphony.xwork.spring.SpringExternalReferenceResolver"
>
<
interceptors
>
<
interceptor
name
=
"reference-resolver"
class
=
"com.opensymphony.xwork.interceptor.ExternalReferencesInterceptor"
/>
<
interceptor-stack
name
=
"myDefaultWebStack"
>
<
interceptor-ref
name
=
"defaultStack"
/>
<
interceptor-ref
name
=
"reference-resolver"
/>
</
interceptor-stack
>
</
interceptors
>
<
default-interceptor-ref
name
=
"myDefaultWebStack"
/>
<
action
name
=
"hello"
class
=
"com.ww.test.HelloAction"
>
<
external-ref
name
=
"helloBean"
>
helloBean
</
external-ref
>
<
result
name
=
"success"
>
/WEB-INF/pages/hello.jsp
</
result
>
</
action
>
</
package
>
</
xwork
>
HelloAction:
代码
import
com.opensymphony.xwork.ActionSupport;
public
class
HelloAction
extends
ActionSupport {
private
String message;
private
HelloBean helloBean;
@Override
public
String execute()
throws
Exception {
// TODO Auto-generated method stub
message = helloBean.getMsg();
return
SUCCESS;
}
public
String getMessage() {
return
message;
}
public
void
setHelloBean(HelloBean helloBean) {
this
.helloBean = helloBean;
}
}
HelloBean:
代码
public
class
HelloBean {
private
String msg =
"HelloWorld"
;
public
String getMsg() {
return
msg;
}
public
void
setMsg(String msg) {
this
.msg = msg;
}
}
posted on 2007-01-24 18:45
坚持学习,每天进步一些
阅读(869)
评论(0)
编辑
收藏
所属分类:
Spring
新用户注册
刷新评论列表
只有注册用户
登录
后才能发表评论。
网站导航:
博客园
IT新闻
Chat2DB
C++博客
博问
管理
相关文章:
webWork整合Spring例子
webwork+spring最简单的集成 [转]