CS 4385 - Topics in Software Engineering

星期一, 11月 14, 2005

Search Engine Optimization

You can have several ways to optimize your web sites. So people can easy to find it and increase the click count.

Powerpoint

Reference Link

星期一, 10月 31, 2005

P2P

P2P - Peer to Peer

Powerpoint

Reference Link

JXTA: P2P Grows Up
JXTA

星期一, 10月 24, 2005

Web Service

SOA - Service-Oriented Architecture

Powerpoint

Reference link
SOA programming model for implementing Web services

星期一, 10月 17, 2005

Web Pages Development

3 areas we should notice
  1. Development - syntax and guidelines
  2. Accessibility - readability by user
  3. Internationalization


Reference Link

Powerpoint for presentation
Web Pages Development.ppt

星期一, 10月 03, 2005

Project Presentation

Power Point Presentation

星期二, 9月 20, 2005

XMLHttpRequest

Dynamic HTML and XML: The XMLHttpRequest Object

From previous post. We use JSON as a medium to transfer data or function.
XHttpRequest is a protocal and interface to transmit JSON.

Example

Sending Request
function loadXMLDoc(url) {
...
if(req) {
req.onreadystatechange = processReqChange;
req.open("GET", url, true);
req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
req.send("");

}

}
Receive response
function processReqChange() {
if (req.readyState == 4) {
if (req.status == 200) {
} else {
alert("There was a problem retrieving the XML data:\n" + req.statusText);

}

}

}
Display response message
function showDetail(evt) {
evt = (evt) ? evt : ((window.event) ? window.event : null);
var items, content, div;
if (evt) {
var select = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
loadXMLDoc(select.value);
items = req.responseXML.selectNodes("//item");
content = items(0).text;
div = document.getElementById("details");
div.innerHTML = "";
div.innerHTML = content;

}

}

From the above example, the reponse XML can be JSON data

<item>
{"menu": {
"id": "file",
"value": "File:",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
}
}}
</item>

Notice, there is a IE cache issue. When duplicated request is made, IE will ignore new request by response the cached result.
To enforce IE to get the leastest reponse. The following code may be use.
req.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
but when i using this. items = req.responseXML.selectNodes("//item"); will get nothing return.

星期二, 9月 13, 2005

JSON

Introduction of JSON

JSON is a string like structure to exchange information between client and server.
Except data (string, boolean, int, etc) you can exchange javascript function too.

for example:

<script language = "JavaScript">
<!--

var myJSONObject5 =
{
"test2": function (arg){ alert('This is a argument : '+arg) }
}

//-->
</script>
<form>
test2() method of object myJSONObject5test2() Giving argument 'hello', it executes<br>
<input type = "button"
onclick = "myJSONObject5.test2('hello')"
value = "click"><br><br>
</form>

So you can according to different user's preference, giving different javascript action.

for example:

var http_request = new XMLHttpRequest();
var url = "http://example.net/testingServlet?parameter1=TEST";

http_request.onreadystatechange = handle_json;
http_request.open("POST", url, true);
http_request.send(null);

in the above example, you can integrated with JAVA Servlet to return a JSON to client by using JSON in java API

JSMIN is a small program to minized javascript file by removing comments and return characters.