木木
BlogJava
::
首頁
::
新隨筆
::
聯(lián)系
::
聚合
::
管理
::
21 隨筆 :: 4 文章 :: 5 評論 :: 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
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
給我留言
查看公開留言
查看私人留言
隨筆分類
(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專題
不錯的地方
It公司速查
java
java
linux學(xué)習(xí)
lvs
mvn
MySql5.1官方中文手冊
Mysql中文
springside
WEB2.0
Yahoo
開源大全
擴展,性能
技術(shù)
數(shù)據(jù)庫
服務(wù)器開發(fā)
知識型博客
搜索
最新隨筆
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í)一: 一個小實例
11.?js 實現(xiàn)動態(tài)文字滾動
12.?Struts2+Hibernate中關(guān)閉Session的filter問題
13.?Struts2中出錯
14.?Struts2在Resin3.0X中運行的配置
15.?css的問題
16.? jsp URL中文亂碼問題
17.?Hibernate3.2 核心包作用
18.?struts2出錯
19.?FireWorks快捷鍵
最新評論
1.?re: Hibernate3.2 核心包作用
@zzy
antlr.jar我測試的時候好像沒用到也可以通。。。 不過整理的太好了,要是我早發(fā)現(xiàn)該有多好
--cheng8441036
2.?re: js 實現(xiàn)動態(tài)文字滾動
頂一下!
--wjl
3.?re: jsp URL中文亂碼問題
這個雙數(shù)個漢字是行的,但是如果是單數(shù)個漢字就不行了
--jsp
4.?re: Hibernate3.2 核心包作用[未登錄]
最小必要包好像寫多了
--zzy
5.?re: Hibernate3.2 核心包作用[未登錄]
好
--zzy
閱讀排行榜
1.? jsp URL中文亂碼問題(3334)
2.?Hibernate3.2 核心包作用(2761)
3.?c3p0 .Communications link failure due to underlying exception(2352)
4.?js 實現(xiàn)動態(tài)文字滾動(1438)
5.?Struts2+Hibernate中關(guān)閉Session的filter問題(1241)
評論排行榜
1.?Hibernate3.2 核心包作用(3)
2.? jsp URL中文亂碼問題(1)
3.?js 實現(xiàn)動態(tài)文字滾動(1)
4.?Struts2+Hibernate中關(guān)閉Session的filter問題(0)
5.?Struts2中出錯(0)
Stripes使用Ajax
最近在看JQuery,又在使用Stripes,于是想把他們結(jié)合起來實現(xiàn)Ajax效果
配置web.xml,導(dǎo)入stripes類庫,在目錄中加入jquery.js
在頁面中實現(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
>
我要測試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
閱讀(774)
評論(0)
編輯
收藏
所屬分類:
stripes
、
JQuery
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發(fā)表評論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關(guān)文章:
Stripes使用Ajax
在Stripes中下載excel表格
Stripes學(xué)習(xí)一: 一個小實例
Powered by:
BlogJava
Copyright © KTOO
主站蜘蛛池模板:
蜜芽亚洲av无码精品色午夜
|
黄色大片免费网站
|
夜夜嘿视频免费看
|
曰批全过程免费视频免费看
|
99久久99这里只有免费的精品
|
亚洲沟沟美女亚洲沟沟
|
日韩一区二区三区免费体验
|
久久久久免费视频
|
亚洲成av人片在线看片
|
亚洲国产成人精品无码久久久久久综合
|
国精产品一区一区三区免费视频
|
亚洲一级大黄大色毛片
|
久久久久亚洲精品无码网址
|
9久9久女女免费精品视频在线观看
|
色多多A级毛片免费看
|
亚洲欧洲精品国产区
|
久久精品国产亚洲精品
|
国产免费看JIZZ视频
|
青青操免费在线观看
|
亚洲AV无码一区二区三区网址
|
亚洲国产精品无码久久SM
|
日本不卡在线观看免费v
|
最近中文字幕免费完整
|
一个人免费观看视频在线中文
|
亚洲?v女人的天堂在线观看
|
久久国产乱子伦免费精品
|
在线观看亚洲视频
|
日本亚洲免费无线码
|
亚洲日本一区二区三区
|
亚洲国产电影av在线网址
|
成年女人色毛片免费看
|
97在线视频免费播放
|
国产人成网在线播放VA免费
|
亚洲成在人线在线播放无码
|
亚洲综合激情另类小说区
|
亚洲伊人久久大香线蕉综合图片
|
久久国产亚洲精品麻豆
|
又黄又爽一线毛片免费观看
|
最近免费中文字幕4
|
亚洲免费电影网站
|
久久一本岛在免费线观看2020
|