168 CHAPTER 8 THE JAVA COMPILER API
Scripting and JSR 223 CHAPTER 9 What can it be now? When I first heard about scripting support in Java 6, I understood it to mean that the Mozilla Rhino JavaScript interpreter would be embedded in the platform. Using a JEditorPane, you would be able to not only show HTML in the component, but also have it execute the JavaScript on the web pages your users visit, allowing the component to be more like a full-fledged browser than just an HTML viewer for help text. But, that isn t where the scripting support in Mustang went. Instead, while Rhino is present, JSR 223 adds to Mustang a common interface to integrate any scripting language (like PHP or Ruby not just JavaScript), a framework for those scripting languages to access the Java platform, and a command-line scripting shell program, jrunscript. Before looking at the different elements offered by JSR 223, take a look at Table 9-1, which shows the relatively small size of the javax.script package, which provides the public APIs to the new scripting support library. Table 9-1. javax.script.* Package Sizes Package Version Interfaces Classes Throwable Total script 6.06 50+1 12 While I haven t been involved with JSR 223 since its beginning in 2003, I ve gathered that the JSR originated from a desire for a language for scripting web servlets with something comparable to the Bean Scripting Framework (or BSF for short). Yes, BSF is an Apache project (see http://jakarta.apache.org/bsf). BSF offered (offers?) a tag library for JavaServer Pages (JSP), allowing you to write web pages in languages other than the Java programming language. A package named something like javax.script.http would integrate with your servlets for execution on your web servers, with the script results passed back to the browser. At least for Mustang, what seems to have morphed out of the deal is something more appropriate for the standard edition of Java than for the enterprise edition. So, instead of a new javax.script.http package, you get just javax.script with no real direct web hooks, yet. And as best as can be found, it has little to no direct servlet or JSP relationship. Surely
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost JSP Web Hosting services