• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

Javax Script

Java ScriptEngineFactory Example

April 22, 2014 //  by Krishna Srinivasan//  Leave a Comment

This example shows how to get the details of the script engines supported by your JVM. Java supports the different script engines that can be retrieved and used depends upon the client side scripts. Java provides javax.script.ScriptEngineFactory for storing all the script engine details like script engine name, version, default script engine, language, etc. You …

Category: JavaTag: Javax Script

How To Import Java Package Inside JavaScript using ScriptEngine

April 22, 2014 //  by Krishna Srinivasan//  Leave a Comment

This example show how to import Java package inside JavaScript. We can import the Java package and use the classes inside the scripts. In this example, I have imported the java.util package and use java.util.Date class to print today’s date. Lets look at the example. JavaScriptEngineImportPackageExample.java Output…

Category: JavaTag: Javax Script

How To Run External JavaScript File using ScriptEngine

April 22, 2014 //  by Krishna Srinivasan//  Leave a Comment

This example is to show how to load the script files to ScriptEngine and evaluate it. In our previous example I have explained how to write script in the Java file and use it in the Java method. In real scenario, scripts written in the external files with bunch of code. We have load the …

Category: JavaTag: Javax Script

Invoke Script Function using ScriptEngine

April 22, 2014 //  by Krishna Srinivasan//  Leave a Comment

This is an example of invoking a method in the Script using Java. We have to create javax.script.ScriptEngineManager and javax.script.ScriptEngine to invoke the methods. In this example I have created two methods one without parameter and one with two parameters. Once we have created the script engine instances, then we need to get javax.script.Invocable instance …

Category: JavaTag: Javax Script

How To Get Java ScriptEngine By MimeType

April 22, 2014 //  by Krishna Srinivasan//  Leave a Comment

This example shows how to get the script engine by using the mimetype. This is the first step when you are using the Java script engines for executing the scripts. Before your run the scripts, you must get the javax.script.ScriptEngine instance from javax.script.ScriptEngineManager. The engines are registered using the Names ,Extensions and Mimetype. This example …

Category: JavaTag: Javax Script

How To Get Java ScriptEngine By Extension

April 22, 2014 //  by Krishna Srinivasan//  Leave a Comment

This example shows how to get the script engine by using the extension. This is the first step when you are using the Java script engines for executing the scripts. Before your run the scripts, you must get the javax.script.ScriptEngine instance from javax.script.ScriptEngineManager. The engines are registered using the Names ,Extensions and Mimetypes. This example …

Category: JavaTag: Javax Script

How To Get Java ScriptEngine By Name

April 22, 2014 //  by Krishna Srinivasan//  Leave a Comment

This example shows how to get the script engine by using the name. This is the first step when you are using the Java script engines for executing the scripts. Before you run the scripts, you must get the javax.script.ScriptEngine instance from javax.script.ScriptEngineManager. The engines are registered using the Names ,Extensions and Mimetypes. This example …

Category: JavaTag: Javax Script

Java ScriptEngine Example

April 21, 2014 //  by Krishna Srinivasan//  Leave a Comment

This example demonstrates how to access the Java object from JavaScript statements. Java support the JavaScript access with the ScriptEngineManager class and ScriptEngine interface. Here you will see how we can execute the JavaScript code using the Java API’s. Create ScriptEngineManager which tracks the states of all the script engines. Create ScriptEngine by using the …

Category: JavaTag: Javax Script

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

EJB 3.0 Timer Services

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact