webIM
A distributed web-based instant messenger
Implemented using Edge-Side Include technology
Java servlets, JSP and JESI custom tags
No central server required
ESI cache server performs integration function for:
- buddy list : on-line status of remote partners
- chat text : submitted by local and remote users
webIM
Site Design
Consists of 3 pages
- login
- buddy list
- chat
Interaction diagram.
- Complex interaction between
* browser
* Javascript heartbeat
* ESI directives
JSP and JESI Code
For collection of buddies’ online status and
collection of remote text
E.g., to get online status for buddy, Jim Jones
<table>
<tr>
<esi:try>
<esi:attempt>
<esi:include src="http://remote.uccs.edu/~jjones/webIM/jjones_online.jpg"/>
<td>
<a href="chat.html" onclick="setBuddyName('Jim Jones')">
<h3>Jim Jones</h3>
</a>
</td>
</esi:attempt>
<esi:except>
<esi:try>
<esi:attempt>
<td>
<esi:include src="http://remote.uccs.edu/~jjones/webIM/jjones_offline.jpg"/>
<h3>Jim Jones</h3>
</td>
</esi:attempt>
<esi:except>
<td>
<img src="http://local.uccs.edu:8064/webIM/notfound.jpg"/>
<h3>Jim Jones</h3>
</td>
</esi:except>
</try>
</esi:except>
</esi:try>
</tr>
</table>