File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Applets and scripting constraints? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applets and scripting constraints?" Watch "Applets and scripting constraints?" New topic
Author

Applets and scripting constraints?

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 388
I know groovy is incompatible with applets and I know jython works well for implementing applets (or at least the hello world applet works with jython). What are the other constraints with regard to scripting languages and applets?

For example: with java 1.6 javascript is now official. Does that mean I can write applets using javascript just like I can with jython? What other JVM scripting languages can I use for creating applets?

Now what about creating an applet that has a command prompt so the user can type in javascript code and have the applet execute it dynamically. Is that allowed? What other scripting language interpreter/compilers can be called from an applet?

Thanks,
Siegfried
Ananth Chellathurai
Ranch Hand

Joined: Nov 21, 2007
Posts: 349

Hi,

with java 1.6 javascript is now official.
Can I get some URL stating this.

Thanks
Ananth Chellathurai


Ananth Chellathurai [Walk on software]
Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 388
http://java.sun.com/javase/6/webnotes/

"Java SE 6 includes the javax.script API (JSR 223) and a Rhino (Rhino) based JavaScript engine reference implementation."

So what does this mean in terms of applets?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
It means that Java can now execute JavaScript code, and that it's possible to pass data back and forth between Java and JavaScript. So, yes, entering JavaScript expressions and having them evaluated would be a possibility.

But that's been possible using the native Rhino API for years, and the Apache BSF library has put a universal API on top of quite a few scripting languages for almost that long. So I don't see much new stuff happening that wasn't possible before.
Matthew Taylor
Rancher

Joined: Jun 13, 2004
Posts: 110
Originally posted by Siegfried Heintze:
I know groovy is incompatible with applets ...


Maybe, maybe not.

Andres Almiray has done a lot of work with Groovy and applets. You might want to check out his posts on the topic.


Grails Consultant
http://dangertree.net
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applets and scripting constraints?