木木
BlogJava
::
首頁
::
新隨筆
::
聯(lián)系
::
聚合
::
管理
::
21 隨筆 :: 4 文章 :: 5 評(píng)論 :: 0 Trackbacks
<
2008年3月
>
日
一
二
三
四
五
六
24
25
26
27
28
29
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
常用鏈接
我的隨筆
我的評(píng)論
我的參與
最新評(píng)論
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
(14)
Hibernate學(xué)習(xí)(1)
(rss)
JDO
(rss)
JQuery(1)
(rss)
js+CSS
(rss)
JSP+Servelet學(xué)習(xí)(2)
(rss)
linux(2)
(rss)
Mina
(rss)
PHP
(rss)
Spring學(xué)習(xí)(1)
(rss)
stripes(3)
(rss)
Struts2學(xué)習(xí)(4)
(rss)
隨筆檔案
(19)
2011年7月 (3)
2009年6月 (1)
2008年12月 (2)
2008年11月 (1)
2008年3月 (3)
2008年2月 (3)
2007年12月 (1)
2007年11月 (2)
2007年8月 (3)
技術(shù)
DBA
IBM J2EE專題
不錯(cuò)的地方
It公司速查
java
java
linux學(xué)習(xí)
lvs
mvn
MySql5.1官方中文手冊(cè)
Mysql中文
springside
WEB2.0
Yahoo
開源大全
擴(kuò)展,性能
技術(shù)
數(shù)據(jù)庫
服務(wù)器開發(fā)
知識(shí)型博客
搜索
最新隨筆
1.?Linux c學(xué)習(xí)之 IDE打造--VIM(三),IDE界面
2.?Linux c學(xué)習(xí)之 IDE打造--VIM(二),Hello world
3.?Linux c學(xué)習(xí)之 IDE打造--VIM(一), 語法
4.?UltraEdit下Mysql語法加亮
5.?resin3+apache2.2整合
6.?c3p0 .Communications link failure due to underlying exception
7.?windows 下ubuntu8.10初學(xué)配置
8.?Stripes使用Ajax
9.?在Stripes中下載excel表格
10.?Stripes學(xué)習(xí)一: 一個(gè)小實(shí)例
11.?js 實(shí)現(xiàn)動(dòng)態(tài)文字滾動(dòng)
12.?Struts2+Hibernate中關(guān)閉Session的filter問題
13.?Struts2中出錯(cuò)
14.?Struts2在Resin3.0X中運(yùn)行的配置
15.?css的問題
16.? jsp URL中文亂碼問題
17.?Hibernate3.2 核心包作用
18.?struts2出錯(cuò)
19.?FireWorks快捷鍵
最新評(píng)論
1.?re: Hibernate3.2 核心包作用
@zzy
antlr.jar我測(cè)試的時(shí)候好像沒用到也可以通。。。 不過整理的太好了,要是我早發(fā)現(xiàn)該有多好
--cheng8441036
2.?re: js 實(shí)現(xiàn)動(dòng)態(tài)文字滾動(dòng)
頂一下!
--wjl
3.?re: jsp URL中文亂碼問題
這個(gè)雙數(shù)個(gè)漢字是行的,但是如果是單數(shù)個(gè)漢字就不行了
--jsp
4.?re: Hibernate3.2 核心包作用[未登錄]
最小必要包好像寫多了
--zzy
5.?re: Hibernate3.2 核心包作用[未登錄]
好
--zzy
閱讀排行榜
1.? jsp URL中文亂碼問題(3339)
2.?Hibernate3.2 核心包作用(2770)
3.?c3p0 .Communications link failure due to underlying exception(2357)
4.?js 實(shí)現(xiàn)動(dòng)態(tài)文字滾動(dòng)(1445)
5.?Struts2+Hibernate中關(guān)閉Session的filter問題(1247)
評(píng)論排行榜
1.?Hibernate3.2 核心包作用(3)
2.? jsp URL中文亂碼問題(1)
3.?js 實(shí)現(xiàn)動(dòng)態(tài)文字滾動(dòng)(1)
4.?Struts2+Hibernate中關(guān)閉Session的filter問題(0)
5.?Struts2中出錯(cuò)(0)
Stripes使用Ajax
最近在看JQuery,又在使用Stripes,于是想把他們結(jié)合起來實(shí)現(xiàn)Ajax效果
配置web.xml,導(dǎo)入stripes類庫,在目錄中加入jquery.js
在頁面中實(shí)現(xiàn)/ajax/test1.jsp
1
<%
@ page language
=
"
java
"
contentType
=
"
text/html; charset=UTF-8
"
2
pageEncoding
=
"
UTF-8
"
%>
3
<%
@ taglib prefix
=
"
stripes
"
uri
=
"
http://stripes.sourceforge.net/stripes.tld
"
%>
4
<!
DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"
>
5
<
html
>
6
<
head
>
7
<
meta
http-equiv
="Content-Type"
content
="text/html; charset="
UTF-8"
>
8
<
title
></
title
>
9
<
script
type
="text/javascript"
src
="../skin/js/jquery.js"
></
script
>
10
<
script
type
="text/javascript"
>
11
$(document).ready(
function
()
{
12
alert(
"
f
"
);
13
$(
"
#subAjax
"
).click(
function
()
{
14
name
=
$(
"
#name
"
).val();
15
des
=
$(
"
#des
"
).val();
16
$.ajax(
{
17
type:
"
post
"
,
18
url:
"
${pageContext.request.contextPath}/AjaxTest.action
"
,
19
data:
"
name=
"
+
name
+
"
&describ=
"
+
des,
20
success:
function
(result)
{
21
$('
<
p
></
p
>
')
22
.html(result)
23
.css('background', '#F0F0F0')
24
.appendTo(
"
body
"
);
25
}
26
}
)
27
return
true
;
28
}
)
29
30
}
);
31
</
script
>
32
</
head
>
33
<
body
>
34
<
p
>
我要測(cè)試ajax
</
p
>
35
<
stripes:form
action
="${pageContext.request.contextPath}/AjaxTest.action"
>
36
<
table
>
37
<
tr
>
38
<
td
>
用戶名:
</
td
><
td
>
<
stripes:text
name
="name"
id
="name"
></
stripes:text
></
td
>
39
</
tr
>
40
<
tr
>
41
<
td
>
說明:
</
td
><
td
><
stripes:text
name
="describ"
id
="des"
/></
td
>
42
</
tr
>
43
</
table
>
44
<
stripes:button
name
="subAjax"
id
="subAjax"
value
="提交"
></
stripes:button
>
45
</
stripes:form
>
46
</
body
>
47
</
html
>
寫ActionBean類 AjaxTestActionBean
1
package
com.test.action;
2
3
import
java.io.StringReader;
4
5
import
net.sourceforge.stripes.action.ActionBean;
6
import
net.sourceforge.stripes.action.ActionBeanContext;
7
import
net.sourceforge.stripes.action.DefaultHandler;
8
import
net.sourceforge.stripes.action.RedirectResolution;
9
import
net.sourceforge.stripes.action.Resolution;
10
import
net.sourceforge.stripes.action.StreamingResolution;
11
12
public
class
AjaxTestActionBean
implements
ActionBean
{
13
private
String name;
14
private
String describ;
15
private
String result;
16
private
ActionBeanContext context;
17
@DefaultHandler
18
public
Resolution subAjax()
{
19
result
=
"
Name is:
"
+
name;
20
result
=
result
+
"
<br/>
"
;
21
result
=
result
+
"
Description:
"
+
describ;
22
return
new
StreamingResolution(
"
text
"
,
new
StringReader(result));
23
}
24
25
public
String getResult()
{
26
return
result;
27
}
28
public
void
setName(String name)
{
29
this
.name
=
name;
30
}
31
public
void
setDescrib(String describ)
{
32
this
.describ
=
describ;
33
}
34
public
ActionBeanContext getContext()
{
35
return
context;
36
}
37
public
void
setContext(ActionBeanContext arg0)
{
38
this
.context
=
arg0;
39
}
40
41
}
42
訪問頁面
http://localhost:8080/mytest/ajax/test1.jsp
posted on 2008-03-28 14:51
KTOO
閱讀(779)
評(píng)論(0)
編輯
收藏
所屬分類:
stripes
、
JQuery
新用戶注冊(cè)
刷新評(píng)論列表
只有注冊(cè)用戶
登錄
后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關(guān)文章:
Stripes使用Ajax
在Stripes中下載excel表格
Stripes學(xué)習(xí)一: 一個(gè)小實(shí)例
Powered by:
BlogJava
Copyright © KTOO
主站蜘蛛池模板:
四虎最新永久免费视频
|
精品免费久久久久久成人影院
|
亚洲精品乱码久久久久久V
|
国产亚洲av片在线观看播放
|
免费看美女让人桶尿口
|
3d动漫精品啪啪一区二区免费
|
国产日韩精品无码区免费专区国产
|
亚洲精品永久在线观看
|
亚洲的天堂av无码
|
亚洲妇熟XXXX妇色黄
|
亚洲综合区小说区激情区
|
日本成人免费在线
|
国产精品无码免费播放
|
84pao强力永久免费高清
|
a级毛片免费全部播放无码
|
一级毛片a免费播放王色
|
青草青草视频2免费观看
|
亚洲国产成人无码AV在线
|
精品亚洲AV无码一区二区三区
|
亚洲黄色一级毛片
|
婷婷精品国产亚洲AV麻豆不片
|
黄床大片30分钟免费看
|
最新亚洲精品国偷自产在线
|
亚洲成AV人片久久
|
亚洲欧洲校园自拍都市
|
亚洲欧洲日韩国产综合在线二区
|
久久精品国产亚洲麻豆
|
亚洲精品无码永久中文字幕
|
亚洲伊人久久大香线蕉综合图片
|
亚洲精品视频在线看
|
亚洲国产成人精品女人久久久
|
在线天堂免费观看.WWW
|
免费在线观看h片
|
久草视频在线免费
|
成人免费视频69
|
91在线品视觉盛宴免费
|
中字幕视频在线永久在线观看免费
|
中文字幕乱码免费视频
|
亚洲成在人线aⅴ免费毛片
|
91免费资源网站入口
|
免费看的一级毛片
|