I wrote a simple taglib (called Script) that takes the contents of my body, wraps it in an HTML element, <script>and inserts it at the end of an external taglib (called Body). This is the initialization automation of Zurb Foundation 4 . This means that JSP:
<r:page>
<r:head title='Test Site'/>
<r:body>
<div id='thing'></div>
<r:script>
$(function() {
$('#thing').html('DOM is ready');
});
</r:script>
</r:body>
</r:page>
It displays like this HTML:
<!DOCTYPE html>
<html class='no-js' lang='en'>
<head>
<meta http-equiv='content-type' content='text/html;charset=UTF-8' />
<title>Test Site</title>
<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>
<link rel='stylesheet' href='/css/foundation.min.css'>
<script src='/js/vendor/custom.modernizr.js'></script>
</head>
<body>
<div id='thing'></div>
<script>
document.write('<script src=/js/vendor/' + ('__proto__' in {} ? 'zepto' : 'jquery') + '.js><\/script>')
</script>
<script src='/js/foundation.min.js'></script>
<script>
$(document).foundation();
$(function() {
$('#thing').html('DOM is ready');
});
</script>
</body>
</html>
, Eclipse WTP JSP Editor script taglib HTML, JavaScript. - (, .tld TagInfo, JSP, JavaScript?) <script></script> ( taglib - onFoundationReady). , , , , Zepto/jQuery $(document).foundation(); , , Facebook Connect SDK JavaScript, , taglib )