Taconite
Taconite is a J2EE-based framework for simplifying Ajax development. Taconite includes a client-side JavaScript library and custom JSP tags that automate the Ajax request and generating dynamic content.Hello World
index.html
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
3
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4
<head>
5
<script type="text/javascript" src="taconite-client.js"></script>
6
<script type="text/javascript" src="taconite-parser.js"></script>
7
8
<script type="text/javascript">
9
function doHelloWorld(url)
{
10
var ajaxRequest = new AjaxRequest(url); //Create AjaxRequest object
11
ajaxRequest.sendRequest(); //Send the request
12
}
13
</script>
14
</head>
15
<body>
16
<a href="javascript:doHelloWorld('example-jsp.jsp');">Hello World (JSP parser)</a>
17
<br/>
18
<a href="javascript:doHelloWorld('example-all.jsp');">Hello World (Any server-side tech)</a>
19
20
<br/><br/>
21
<div id="helloWorldContainer">
22
23
</div>
24
</body>
25
</html>
example-jsp.jsp

2

3

4

5

6

7

8



9



10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

1
<%@ taglib uri="http://taconite.sf.net/tags" prefix="tac" %>
2
3
<tac:taconiteRoot>
4
<tac:appendAsChildren contextNodeID="helloWorldContainer" parseOnServer="true">
5
6
<div style="font-weight:bold;color:red;">
7
Taconite says: Hello World!!!
8
</div>
9
<%
10
out.println("free"); // 太親切了, 好free啊
11
%>
12
13
</tac:appendAsChildren>
14
</tac:taconiteRoot>
example-all.jsp

2

3

4

5

6

7

8

9

10

11

12

13

14

1
<%@page contentType="text/xml"%>
2
3
<taconite-root xml:space="preserve">
4
<taconite-append-as-children contextNodeID="helloWorldContainer" parseInBrowser="true">
5
6
<div style="font-weight:bold;color:orange;">
7
Taconite says: Hello World!!!
8
</div>
9
10
</taconite-append-as-children>
11
</taconite-root>

2

3

4

5

6

7

8

9

10

11

詳細參考: depoly taconite-test.war后, http://localhost:8080/taconite-test
BTW: 完全沒有xml配置這種麻煩事啊, 太好了