木木
BlogJava
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
::
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學習(1)
(rss)
JDO
(rss)
JQuery(1)
(rss)
js+CSS
(rss)
JSP+Servelet學習(2)
(rss)
linux(2)
(rss)
Mina
(rss)
PHP
(rss)
Spring學習(1)
(rss)
stripes(3)
(rss)
Struts2學習(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)
技術
DBA
IBM J2EE專題
不錯的地方
It公司速查
java
java
linux學習
lvs
mvn
MySql5.1官方中文手冊
Mysql中文
springside
WEB2.0
Yahoo
開源大全
擴展,性能
技術
數據庫
服務器開發
知識型博客
搜索
最新隨筆
1.?Linux c學習之 IDE打造--VIM(三),IDE界面
2.?Linux c學習之 IDE打造--VIM(二),Hello world
3.?Linux c學習之 IDE打造--VIM(一), 語法
4.?UltraEdit下Mysql語法加亮
5.?resin3+apache2.2整合
6.?c3p0 .Communications link failure due to underlying exception
7.?windows 下ubuntu8.10初學配置
8.?Stripes使用Ajax
9.?在Stripes中下載excel表格
10.?Stripes學習一: 一個小實例
11.?js 實現動態文字滾動
12.?Struts2+Hibernate中關閉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我測試的時候好像沒用到也可以通。。。 不過整理的太好了,要是我早發現該有多好
--cheng8441036
2.?re: js 實現動態文字滾動
頂一下!
--wjl
3.?re: jsp URL中文亂碼問題
這個雙數個漢字是行的,但是如果是單數個漢字就不行了
--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 實現動態文字滾動(1445)
5.?Struts2+Hibernate中關閉Session的filter問題(1247)
評論排行榜
1.?Hibernate3.2 核心包作用(3)
2.? jsp URL中文亂碼問題(1)
3.?js 實現動態文字滾動(1)
4.?Struts2+Hibernate中關閉Session的filter問題(0)
5.?Struts2中出錯(0)
Stripes使用Ajax
最近在看JQuery,又在使用Stripes,于是想把他們結合起來實現Ajax效果
配置web.xml,導入stripes類庫,在目錄中加入jquery.js
在頁面中實現/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
閱讀(779)
評論(0)
編輯
收藏
所屬分類:
stripes
、
JQuery
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
Stripes使用Ajax
在Stripes中下載excel表格
Stripes學習一: 一個小實例
Powered by:
BlogJava
Copyright © KTOO
主站蜘蛛池模板:
免费精品视频在线
|
永久免费AV无码网站国产
|
亚洲a∨国产av综合av下载
|
午夜在线免费视频
|
最近2018中文字幕免费视频
|
国产美女无遮挡免费网站
|
亚洲AV无码第一区二区三区
|
亚洲av片在线观看
|
国产美女精品久久久久久久免费
|
亚洲av综合日韩
|
最近免费视频中文字幕大全
|
亚洲综合色丁香麻豆
|
在线播放国产不卡免费视频
|
亚洲日本中文字幕天堂网
|
亚洲国产成人精品激情
|
国产麻豆一精品一AV一免费
|
国产在线观看免费视频播放器
|
看亚洲a级一级毛片
|
亚洲成a人在线看天堂无码
|
亚洲中文字幕无码mv
|
久久久精品午夜免费不卡
|
亚洲国产精品久久久久
|
成年免费a级毛片免费看无码
|
在线看片无码永久免费aⅴ
|
精品亚洲国产成人
|
99久在线国内在线播放免费观看
|
亚洲日韩av无码
|
一个人免费观看www视频
|
国产不卡免费视频
|
亚洲avav天堂av在线网毛片
|
亚洲精品视频免费
|
无码人妻一区二区三区免费视频
|
亚洲精品国产品国语在线
|
国产一级婬片A视频免费观看
|
久久精品国产亚洲AV电影
|
日本免费一区二区三区四区五六区
|
亚洲人和日本人jizz
|
日韩免费高清大片在线
|
亚洲色大情网站www
|
亚洲精品无码专区久久久
|
精品韩国亚洲av无码不卡区
|