Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applets and scripting constraints?

 
Siegfried Heintze
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thanks
Ananth Chellathurai
 
Siegfried Heintze
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic