Prototaglib is a JSP Tag library to make using the Prototype javascript library a bit easier. It's influenced from the Ruby on Rails approach.
Those familiar with the Ruby On Rails site may have seen the Ajax demo using the flickr api. You can watch the same sort of demo using the Prototaglib setup, using the FlickrJ api. The whole web app is also in the distribution zip/tar.gz file so you can see how it works. Watch the screen cast now.
<%@taglib uri="/WEB-INF/prototypetaglib.tld" prefix="prototype"%>
<prototype:loadScripts scriptdir="js" libs="prototype, effects" />will produce...
<script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript" src="js/effects.js"></script>
<prototype:linkRemoteTag div="updatethis" hreftext="Click here to test." url="testajax.jsp" /> <div id="updatethis"> </div>There are a number of attributes used: div specifies which div id to update. The url attribute is the the content that will populate within the div tag. hreftext is the text that appear as the link.