Retrieving Script Engines by Name : Script Engines « JDK 6 « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Collections Data Structure
8. Database SQL JDBC
9. Design Pattern
10. Development Class
11. Email
12. Event
13. File Input Output
14. Game
15. Hibernate
16. J2EE
17. J2ME
18. JDK 6
19. JSP
20. JSTL
21. Language Basics
22. Network Protocol
23. PDF RTF
24. Regular Expressions
25. Security
26. Servlets
27. Spring
28. Swing Components
29. Swing JFC
30. SWT JFace Eclipse
31. Threads
32. Tiny Application
33. Velocity
34. Web Services SOA
35. XML
Microsoft Office Word 2007 Tutorial
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Java » JDK 6 » Script EnginesScreenshots 
Retrieving Script Engines by Name
 
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

public class GetEngineByName {
  public static void main(String[] args) {
    ScriptEngineManager manager = new ScriptEngineManager();
    /* Retrieve a ScriptEngine registered with the rhino name */
    ScriptEngine jsEngine = manager.getEngineByName("rhino");
    if (!(jsEngine == null)) {
      System.out.println(jsEngine);
    else {
      System.out.println("\nNo supported script engine foundregistered as Rhino.");
    }
  }
}

        
Related examples in the same category
1. Listing All Script Engines
2. Running Scripts with Java Script Engine
3. Execute Javascript script in a file
4. Variables bound through ScriptEngine
5. Catch ScriptException
6. Any script have to be compiled into intermediate code.
7. With Compilable interface you store the intermediate code of an entire script
8. List the script engines
9. Run JavaScript and get the result by using Java
10. Pass parameter to JavaScript through Java code
11. Get the value in JavaScript from Java Code by reference the variable name
12. Working with Compilable Scripts
13. Call a JavaScript function three times
14. Save the compiled JavaScript to CompiledScript objectSave the compiled JavaScript to CompiledScript object
15. Invoke an function
16. Using thread to run JavaScript by Java
17. Get Script engine by extension name
18. Get a ScriptEngine by MIME type
19. Retrieving the Metadata of Script Engines
20. Retrieving the Supported File Extensions of a Scripting Engine
21. Retrieving the Supported Mime Types of a Scripting Engine
22. Retrieving the Registered Name of a Scripting Engine
23. Executing Scripts from Java Programs
24. Read and execute a script source file
25. Using Java Objects in JavaScript
26. Java Language Binding with JavaScript
w_w_w.__j_a_v__a_2__s__.___c_o__m | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.