[jdom-interest] Re: [Jython-users] Scripting Pages in Java Web Applications

Michel Pelletier michel at dialnetwork.com
Tue Jun 17 12:56:18 PDT 2003


On Tuesday 17 June 2003 08:23, Frank Cohen wrote:
> Hi Mike: On your suggestion I read JSR 223 again
> (http://www.jcp.org/en/jsr/detail?id=223). I have the same concerns as
> when I wrote my email yesterday. Maybe I am misunderstanding 223 and I
> would appreciate your clarification.
>
> I read 223 to say that there will be a standard way from a servlet
> container to run a script. For example, if I am using Tomcat I will be
> able to bundle a PHP script into the WAR file, and when the deployed
> servlet is called, then Tomcat will execute the PHP script by calling
> the PHP interpreter running outside of the Java VM. Is this correct?

As I read it, not necessarily.  The draft proposes an API be created that 
*may* be used through JNI, or may not.  Jython could significantly drive this 
API enough to possibly remove or simplify some parts of the Jython core code; 
or at least remove any magic to be replaced with a standard API.

> How do you see the call being made from Java to the script language
> interpreter?

Using the proposed standard API, whether through JNI or not.

> What I would rather see is a JSR that standardizes the use of Java byte
> codes in scripting languages.

While a noble effort and definately something worth exploring, this 
unreasonable to ask of many scripting languages.  A bridge through JNI is 
perfectly reasonable for *most* (including CPython).

> By doing so, the script languages (PHP,
> Perl, and all the others) would have a standard way to run as 100% Java
> applications

granted a great benefit of Jython

> and have access to any Java object on the classpath.

Does the JSR propose that any object on the classpath will not be available?

> This
> would be a powerful and reliable way to use my existing Java-based
> infrastructure and would promote the Java platform.

Agreed that Jython is superior integration to a JNI bridge; but I think this 
JSR is very reasonable and necessary.  It does not seem invalidate any 100% 
Java scripting solutions or push them aside for a different purpose and could 
propose an API that is very useful to us.

-Michel



More information about the jdom-interest mailing list