From: Timothy H. <tim...@ma...> - 2003-01-25 17:23:52
|
On Saturday, January 25, 2003, at 09:54 AM, Geoffrey Knauth wrote: > Maybe you could use this too, so you could launch JScheme apps via Java > Web Start. > We can use JScheme with JavaWebStart. For example, to run a Scheme Evaluator as a webapp you create a jnlp file as follows: <?xml version="1.0" encoding="utf-8"?> <!-- JNLP File for SchemeEval Demo Application --> <jnlp spec="1.0+" codebase=" http://127.0.0.1:8080" href="/u/SE.jnlp"> <information> <title>a1</title> <vendor>b1</vendor> <homepage href="c1"/> <description>d1</description> <icon href="http://localhost:8080/u/Midterm/dew.jpg"/> <offline-allowed/> </information> <resources> <j2se version="1.4"/> <j2se version="1.3"/> <j2se version="1.2"/> <jar href="u/lib/jscheme.jar"/> </resources> <application-desc main-class="jlib.SNLP"> <argument> (begin (environment-import "jlib/demo/SchemeEval.scm" "SchemeEval:") (SchemeEval:main #()) ) (lambda(e) (display (list "ERROR in jnlp" e)) (newline))) </argument> </application-desc> </jnlp> where u/lib/jscheme.jar is replaced by the URL of your jscheme.jar file and u/SE.jnlp is replaced by the URL of this file. The jlib.SNLP class has a main procedure that evaluates its first argument. Thus, when we pass in the code to load the SchemeEval.scm file from the jar and call its' main, this is done by the webapp. Note that we load the evaluator in a module because it will "eval" the user's code and we don't want the users code to have any effect on the SchemeEval environment... ---Tim--- > Begin forwarded message: > >> From: "Eric Jain" <Eri...@is...> >> Date: Sat Jan 25, 2003 09:46:47 US/Eastern >> To: "David Ripton" <dr...@ri...> >> Cc: "jython-users" <jyt...@li...> >> Subject: [Jython-users] Re: Jython via Java Web Start, minimizing size >> of jython.jar >> >>> Is anyone out there deploying Jython programs via Java Web Start? >> >> Yes. >> >> >>> Just including Jython in our application's jar file would be easy >> >> If you keep jython.jar in a separate file, web start should be clever >> enough to not download it again just because your main application jar >> changed. Optionally, if you want to avoid having jython.jar transferred >> unless it is actually used, you can use web start's lazy loading >> feature. >> >> <resources> >> <package name="org.jython.*" part="jython" recursive="true"/> >> <jar href="main.jar"/> >> <jar href="jython.jar" part="jython" download="lazy"/> >> </resources> >> >> Note: There are some other packages in jython.jar, you'd have to >> declare >> them as well. Also, any Java classes you use within Jython, but not >> anywhere >> else need to be registered explicitly, classloading issue... >> >> from my.test import A, B, C >> >> >> -- >> Eric Jain >> >> >> >> ------------------------------------------------------- >> This SF.NET email is sponsored by: >> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! >> http://www.vasoftware.com >> _______________________________________________ >> Jython-users mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-users >> > |