I have written one small program on how to execute scripts in Java 6.0
Introduction
In this article i will write a small program using Scripting feature in Java 6.0, a new feature introduced in Java 6.0 mustang. This is cool and more useful when we are working with the scripting languages. I am not going to explain in depth, will explain with very small example. In my next article i will write about the advanced features in script programming in java. Follow the steps to run your first script program in Java 6.0 :
Java Scripting in Java 6.0 (Mustang) - Article
Spring Resources and Articles
Struts Tutorials and Articles


This method looks just like normal invocation of Rhino engine.
What are the differences?
I am relatively new to the concept of scripting like your article describes. After reading it I wonder why in the world people would want to do that as opposed to just sticking with plain old Java?
By way of answering Aaron, one reason why somebody would want to incorporate scripting into their Java app(s) might be when some data to be reckoned with is in a format that is native to a particular scripting language. An example of this is JSON: "Javascript Object Notation". Valid JSON constitutes a valid Javascript "object literal" (and by the way is probably the preferred format for returning data from the misnamed AJAX/XMLHttpRequest), and if you incorporate the Rhino/Javascript engine into your application, you might be able to deal more efficiently with JSON data.
One example of scripting with a VM that I like is as a replacement for large XML descriptors. A lot of XML we write is basically a type of interpreted language, we might as well go all the way. Consider for example that .bashrc is configuration, in the format of a script. Instead of writing a parser, and a file format, you just use bash to configure your bash shell.
Another example I heard at JavaOne some years back was a script terminal that allowes you to inspect/change runtime values in an app server. It'd be a bit like changing your unix shell, but instead you're changing the way a running VM is configured.
But aside from that, the Ruby/rails, php, and Python sites demonstrate that scripting has advantages. Not many of the 'famous' web 2.0 sites are java.
Is there even one? Youtube is written in Phyton for example.
(Not that Im saying that youtube needs distributed transactions, but you get the idea)