Is there a way for the Eclipse WTP JSP editor to treat the body of a custom TagLib as JavaScript?

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>
<!--[if IE 8]><html class='no-js lt-ie9' lang='en'><![endif]-->
<!--[if gt IE 8]><!--><html class='no-js' lang='en'><!--<![endif]-->
  <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>
    <!--[if lt IE 9]><script src='http://html5shiv.googlecode.com/svn/trunk/html5.js'></script><![endif]-->
  </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();
      //The contents of the <r:script> from the JSP
      $(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 )

0
1

. JSP, , , , , " ".

WTP, Eclipse , , - .

+1

All Articles