Java 6 Platform Revealed phần 9

Tham khảo tài liệu 'java 6 platform revealed phần 9', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | CHAPTER 8 THE JAVA COMPILER API 169 Summary The Java Compiler API isn t needed by everyone. In fact it isn t needed by most people. It s great for those creating tools like editors or something like JSP engines which require real-time compilation. Thanks to JSR 199 you can do this with Java 6. Chapter 9 moves on to JSR 223 which incorporates even more new features into Mustang. This JSR defines a framework for combining the scripting world with the Java world enabling scripting languages to interact with full-fledged Java objects in a standard way. No longer will you have to explore any vendor-specific options thanks to the new and packages. CHAPTER 9 Scripting and JSR 223 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 package which provides the public APIs to the new scripting support library. Table 9-1. . Package Sizes Package Version Interfaces Classes Throwable Total script 6 5 0 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 .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.