You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(51) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(105) |
Feb
(93) |
Mar
(194) |
Apr
(145) |
May
(100) |
Jun
(111) |
Jul
(117) |
Aug
(126) |
Sep
(233) |
Oct
(138) |
Nov
(164) |
Dec
(109) |
2002 |
Jan
(216) |
Feb
(175) |
Mar
(216) |
Apr
(194) |
May
(157) |
Jun
(140) |
Jul
(158) |
Aug
(73) |
Sep
(105) |
Oct
(164) |
Nov
(104) |
Dec
(95) |
2003 |
Jan
(72) |
Feb
(69) |
Mar
(81) |
Apr
(151) |
May
(101) |
Jun
(139) |
Jul
(99) |
Aug
(118) |
Sep
(115) |
Oct
(151) |
Nov
(161) |
Dec
(102) |
2004 |
Jan
(120) |
Feb
(175) |
Mar
(106) |
Apr
(111) |
May
(54) |
Jun
(78) |
Jul
(76) |
Aug
(105) |
Sep
(94) |
Oct
(143) |
Nov
(75) |
Dec
(85) |
2005 |
Jan
(99) |
Feb
(77) |
Mar
(164) |
Apr
(97) |
May
(79) |
Jun
(57) |
Jul
(65) |
Aug
(102) |
Sep
(95) |
Oct
(129) |
Nov
(123) |
Dec
(52) |
2006 |
Jan
(48) |
Feb
(99) |
Mar
(90) |
Apr
(51) |
May
(81) |
Jun
(136) |
Jul
(56) |
Aug
(109) |
Sep
(50) |
Oct
(44) |
Nov
(74) |
Dec
(75) |
2007 |
Jan
(92) |
Feb
(137) |
Mar
(93) |
Apr
(79) |
May
(52) |
Jun
(74) |
Jul
(143) |
Aug
(175) |
Sep
(154) |
Oct
(137) |
Nov
(88) |
Dec
(90) |
2008 |
Jan
(58) |
Feb
(113) |
Mar
(167) |
Apr
(88) |
May
(105) |
Jun
(37) |
Jul
(87) |
Aug
(72) |
Sep
(56) |
Oct
(41) |
Nov
(102) |
Dec
(70) |
2009 |
Jan
(115) |
Feb
(113) |
Mar
(126) |
Apr
(58) |
May
(125) |
Jun
(45) |
Jul
(90) |
Aug
(125) |
Sep
(84) |
Oct
(61) |
Nov
(111) |
Dec
(61) |
2010 |
Jan
(85) |
Feb
(86) |
Mar
(130) |
Apr
(58) |
May
(57) |
Jun
(32) |
Jul
(25) |
Aug
(50) |
Sep
(41) |
Oct
(65) |
Nov
(63) |
Dec
(24) |
2011 |
Jan
(43) |
Feb
(31) |
Mar
(28) |
Apr
(68) |
May
(53) |
Jun
(42) |
Jul
(58) |
Aug
(26) |
Sep
(51) |
Oct
(76) |
Nov
(60) |
Dec
(9) |
2012 |
Jan
(16) |
Feb
(32) |
Mar
(32) |
Apr
(39) |
May
(16) |
Jun
(19) |
Jul
(3) |
Aug
(11) |
Sep
(35) |
Oct
(47) |
Nov
(28) |
Dec
(18) |
2013 |
Jan
(18) |
Feb
(36) |
Mar
(10) |
Apr
(7) |
May
(7) |
Jun
(27) |
Jul
(17) |
Aug
(35) |
Sep
(19) |
Oct
(31) |
Nov
(8) |
Dec
(22) |
2014 |
Jan
(5) |
Feb
(11) |
Mar
(18) |
Apr
(23) |
May
(26) |
Jun
(14) |
Jul
(18) |
Aug
(26) |
Sep
(20) |
Oct
(48) |
Nov
(13) |
Dec
(9) |
2015 |
Jan
(9) |
Feb
(15) |
Mar
(25) |
Apr
(10) |
May
(26) |
Jun
(6) |
Jul
(13) |
Aug
(5) |
Sep
(14) |
Oct
(36) |
Nov
(24) |
Dec
(18) |
2016 |
Jan
(24) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
(7) |
Jun
(3) |
Jul
(9) |
Aug
(15) |
Sep
(22) |
Oct
(5) |
Nov
(5) |
Dec
(2) |
2017 |
Jan
(20) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(5) |
Jun
(7) |
Jul
(14) |
Aug
(9) |
Sep
(18) |
Oct
(2) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(7) |
Feb
(6) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(18) |
Sep
(8) |
Oct
(9) |
Nov
(4) |
Dec
(6) |
2019 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(8) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
(8) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(1) |
2021 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(5) |
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(5) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: D-Man <ds...@ri...> - 2001-03-23 15:43:05
|
On Fri, Mar 23, 2001 at 12:59:17PM +0100, Peter Arnold wrote: | Hello all, | I am new to Jython-Users and I am beginner to jython... | | Does anyone know what the -D option by invoking tehe Jython-Interpreter can | do? | where can I get more Information about | " jython - Dprop=value Set the jython property prop to value " The -D option is a part of the JVM. It is used to define system properties. They can be accessed with java.lang.System.getProperty( "prop" ) PS. Don't put a space between the '-' and the 'D' (as the above example does). My favorite is : -Dpython.security.respectJavaAccessibility=false <grin> -D |
From: <bc...@wo...> - 2001-03-23 11:44:40
|
[Peter Arnold] >Hello all, >I am new to Jython-Users and I am beginner to jython... > >Does anyone know what the -D option by invoking tehe Jython-Interpreter can >do? >where can I get more Information about > " jython - Dprop=value Set the jython property prop to value " You can find a list of jython properties here: http://www.jython.org/docs/registry.html regards, finn |
From: <arn...@t-...> - 2001-03-23 11:36:59
|
Hello all, I am new to Jython-Users and I am beginner to jython... Does anyone know what the -D option by invoking tehe Jython-Interpreter can do? where can I get more Information about " jython - Dprop=value Set the jython property prop to value " Thanks, -Peter |
From: <bc...@wo...> - 2001-03-23 09:58:46
|
[John E. Conlon] >Hi jython-users, > >While upgrading to Jython 2.0 from JPython 1.1, I have encountered a couple >of comparability problems with my old working code and 2.0. Enclosed is a >java file that demonstrates both problems. > >Problem #1. This code also throws a java.lang.NullPointerException > at >org.python.core.InternalTables.createInternalTables(InternalTables.java:44) > >If I uncomment the PySystemState.initialize(); line it will run. I don't >need this in 1.1. Why now? > >Problem #2. This code will also (When first problem is not encountered) >throw a >Traceback (innermost last): > File "<string>", line 7, in ? >java.lang.NoSuchMethodError > at org.python.core.MakeProxies.makeAdapter(MakeProxies.java:40)... > >If I remove the , 'actionPerformed=exit' from the JButton it will run. This >error is not thrown in 1.1. Not very helpfull I know, but your example works for me. Both with and without the initialize() call. The NoSuchMethodError exception could indicate that you somehow have both jpython.jar and jython.jar on your classpath. If you can't find the cause of the problems, please post the entire stacktraces for both siruations. Maybe that will give me a clue. regards, finn |
From: John E. C. <jc...@ve...> - 2001-03-22 22:38:44
|
Hi jython-users, While upgrading to Jython 2.0 from JPython 1.1, I have encountered a couple of comparability problems with my old working code and 2.0. Enclosed is a java file that demonstrates both problems. Problem #1. This code also throws a java.lang.NullPointerException at org.python.core.InternalTables.createInternalTables(InternalTables.java:44) If I uncomment the PySystemState.initialize(); line it will run. I don't need this in 1.1. Why now? Problem #2. This code will also (When first problem is not encountered) throw a Traceback (innermost last): File "<string>", line 7, in ? java.lang.NoSuchMethodError at org.python.core.MakeProxies.makeAdapter(MakeProxies.java:40)... If I remove the , 'actionPerformed=exit' from the JButton it will run. This error is not thrown in 1.1. (Note that these statements are pulled from the swing demo on the 2.0 Demo directory.) ---------------------------------------------------- package test.jython; import org.python.util.PythonInterpreter; import org.python.core.*; public class InterpreterTest { public static void main(String []args) throws PyException{ //PySystemState.initialize(); //#1 String s2= "from pawt import swing"+"\n"+ "import java"+"\n"+ "\n"+ "def exit(e): java.lang.System.exit(0)"+"\n"+ "\n"+ "frame = swing.JFrame('Swing Example', visible=1)"+"\n"+ "button = swing.JButton('Close Me!', actionPerformed=exit)"+"\n"+ //#2 "frame.contentPane.add(button)"+"\n"+ "frame.pack()" ; PythonInterpreter interp = new PythonInterpreter(); interp.exec(s2); } } ------- Appreciate any ideas, or workarounds anyone may know about. thanks - John |
From: Robert W. B. <rb...@di...> - 2001-03-22 20:30:40
|
Hi Joseph, On Thu, 22 Mar 2001, Joseph S. Barrera III wrote: > I love jython, but as we all know it's missing some library > functionality, especially in the shell/filesystem/os area, for the > reason that it's hard or impossible to implement such functionality in > pure Java. > > Is there some easy way of writing a program mostly in jython, and a > little in cpython (for the functionality missing in jython), and > sticking the parts together? If so, how? The word "easy" limits the field here, doesn't it :) Faking the behavior you need with Runtime() could work, is potentially easy, but is suspect as a solution. Brian was kind enough to post snippets of using getRuntime().exec() recently. His mail is found: http://www.geocrawler.com/lists/3/SourceForge/7017/25/5376101/ Brian also pointed out a nice article on exec() traps found: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html > The reason I don't just go with pure cpython is that I depend a lot on > the nice integration between jython and java, and I suspect that > moving to pure cpython would be a real pain. (But I don't know cpython > well enough to know that for sure.) I doubt cpython would be a pain for someone already comfortable with Jython. Unless you mean that writing C extensions would be required for your project and that portion would be the pain. It seems unlikely that you would need such extensions for os services though. However, this java/Cpython integration seem to be a recurrent issue. There is even a project called cyphon which addresses this, found at: http://www.one.net.au/~effbaie/cyphon.html there is also a jpe project (java python extension maybe?) but I don't know it's url or status. Maybe one of these project would be worth looking into. Cheers, Robert |
From: Robert W. B. <rb...@di...> - 2001-03-22 20:05:09
|
Hi Ron, On Thu, 22 Mar 2001 Ron...@Ne... wrote: > > I have a bunch of properties that I get from the system using Java code, > since that is what handles properties. The data I get back is of type > java.lang.String. These things are used all over the place. > > Which makes more sense: write all the code in Java and just drive it > with Jython, or convert the String data to Python strings? In the latter > case, how do I do the conversion? The "more sense" part is too subjective to really say. String, PyString, PyJavaInstance, and PyInstance make things easy either way you go. As far as converting String to PyString, the PyString constructor takes a String so: String s1; PyString s2 = new PyString(s1); is all you need to make a String a PyString. Below is a little java class that shows what I mean about the ease of moving back and forth between java and jython. file: StringStuff.java ------------------------------------------------------------ import org.python.core.*; import org.python.util.PythonInterpreter; public class StringStuff { public static void main(String[] args) { String osname = System.getProperty("os.name"); System.out.println("Java String in Java --> " + osname); PythonInterpreter interp = new PythonInterpreter(); interp.set("osname", new PyString(osname)); interp.exec("print 'PyString in interpreter -->', osname"); // to check type if you want // interp.exec("print type(osname)"); PyString pyosname = (PyString) interp.get("osname"); System.out.println("PyString in Java --> " + pyosname); interp.set("javaosname", new PyJavaInstance(osname)); interp.exec("print 'java String in interpreter, " + "(which is actually a PyInstance) -->'," + " javaosname"); // to check type again if wanted //interp.exec("print type(javaosname)"); } } ------------------------------------------------------------------ My personal, subjective opinion- you can't beat Jython/Python for string processing, i.e. >>>from java.lang import System >>>lotsofproperties = System.getProperties() Ahh, how easy things get :) Cheers, Robert |
From: Jim A. <ji...@tr...> - 2001-03-22 19:01:45
|
Ron...@Ne... wrote: > > I have a bunch of properties that I get from the system using Java code, > since that is what handles properties. The data I get back is of type > java.lang.String. These things are used all over the place. > > Which makes more sense: write all the code in Java and just drive it > with Jython, or convert the String data to Python strings? In the latter > case, how do I do the conversion? > Of course it depends on your purpose, but I would lean toward putting the info into Jython. Here's a cut/paste of some of my code: import org.python.util.PythonInterpreter; import org.python.core.*; ... PythonInterpreter python; python = new PythonInterpreter(); python.set("debugLevel", new Integer(debugLevel) ); // must pass Object not 'int' python.set("amount", new PyFloat( Double.parseDouble( amountString ) ) ); // so Jython can do math directly ArrayList errorList = new ArrayList(); python.set("errorList", errorList); Note that in the last example, the pointer to the ArrayList is sent to Jython: in the Jython code it calls other Java code using the same pointer ('errorList'), and the Java code actually 'add's to the errorList; i.e. the pointer is just 'passed through' Jython. This all works great and fast since when it actually runs, Jython code is just Java Bytecodes ! Your other option is just to call the Java classes to get the properties from Jython directly. See Bruce Eckel's Jython info below for more info. -- __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ___________ `-' `-' Java/Jython intergration: Chapter 9 at: http://www.bruceeckel.com/TIPatterns/index.html |
From: <Ron...@Ne...> - 2001-03-22 18:39:05
|
I have a bunch of properties that I get from the system using Java code, since that is what handles properties. The data I get back is of type java.lang.String. These things are used all over the place. Which makes more sense: write all the code in Java and just drive it with Jython, or convert the String data to Python strings? In the latter case, how do I do the conversion? Thanks, Ron ron...@ne... (W) ro...@ro... (H) |
From: Joseph S. B. I. <jo...@ba...> - 2001-03-22 18:21:16
|
I love jython, but as we all know it's missing some library functionality, especially in the shell/filesystem/os area, for the reason that it's hard or impossible to implement such functionality in pure Java. Is there some easy way of writing a program mostly in jython, and a little in cpython (for the functionality missing in jython), and sticking the parts together? If so, how? The reason I don't just go with pure cpython is that I depend a lot on the nice integration between jython and java, and I suspect that moving to pure cpython would be a real pain. (But I don't know cpython well enough to know that for sure.) Thanks, - Joe |
From: Chris M. <ch...@hd...> - 2001-03-22 18:09:50
|
You need to import java.awt. I use java.awt.Color.red for example to set border/font/whatever color. Not sure what the p stands for in pawt. Hope that helps. Chris On Fri, 23 Mar 2001 00:49:21 -0500, you wrote: > Hi, > The subject said it all. I'm trying to use the background() method. > I thought that importing pawt would give me access to it. I thought > wrong. > What does the p stand for in pawt? > Thanks. > Wayne > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users > > |
From: <bc...@wo...> - 2001-03-22 17:52:45
|
[Mark Ackerman] >... > >Now I get: > >Traceback (innermost last): > File "<string>", line 1, in ? >AttributeError: class 'Util' has no attribute 'test' > > >for the method: > > public static int test(int a, int b) > { > return a*b; > } > >in the class Util. This works for me: public class Util { public static int test(int a, int b) { return a*b; } } Jython 2.1a1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import Util >>> print Util.test(5,6) 30 regards, finn |
From: cindy <inf...@pi...> - 2001-03-22 16:45:50
|
Hi, The subject said it all. I'm trying to use the background() method. I thought that importing pawt would give me access to it. I thought wrong. What does the p stand for in pawt? Thanks. Wayne |
From: John M. <joh...@ya...> - 2001-03-22 16:34:45
|
I'm able to avoid the problem now. I added a sleep(5) after I instantiate each thread. This is apparently an old problem with thread initialization clashing. --- John Mudd <joh...@ya...> wrote: > I added a simple call to sleep(2) in the run() mathod of some > threads. > The threads now terminate (w/o exception) when the sleep() is > reached. > It's not a critical problem for me. I was just using the sleep() > during debugging. > > > I get the problem when using either Jython 2.0 or 2.1.a1. > > > Here are the only references to sleep() in my program. So I don't > think I've redefined it. > > $ grep sleep conv.py > from time import time, localtime, sleep > sleep(2) > $ > > > > I tried a small test program (attached) but it works as it should. > So > it's something to do with my application. > > I tried "import time" and calling time.sleep(2) instead of sleep(2) > but > that didn't help. > > I tried printing the value of `sleep` before calling it. I got the > same sort of output from both my application that has the problem and > and test program that runs okay. Here's an example: > > sleep=<java function sleep at 1203696510> > > Any suggestions? > > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ > ATTACHMENT part 2 application/x-unknown name=sleepBug.py __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ |
From: John M. <joh...@ya...> - 2001-03-22 15:06:03
|
I added a simple call to sleep(2) in the run() mathod of some threads. The threads now terminate (w/o exception) when the sleep() is reached. It's not a critical problem for me. I was just using the sleep() during debugging. I get the problem when using either Jython 2.0 or 2.1.a1. Here are the only references to sleep() in my program. So I don't think I've redefined it. $ grep sleep conv.py from time import time, localtime, sleep sleep(2) $ I tried a small test program (attached) but it works as it should. So it's something to do with my application. I tried "import time" and calling time.sleep(2) instead of sleep(2) but that didn't help. I tried printing the value of `sleep` before calling it. I got the same sort of output from both my application that has the problem and and test program that runs okay. Here's an example: sleep=<java function sleep at 1203696510> Any suggestions? __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ |
From: cindy <inf...@pi...> - 2001-03-22 12:11:50
|
Hi, I tried to import (G,g)eometry and I get an error that the import module is not to be had. I'm trying to use the Point() method. What should be imported? later. Wayne |
From: <nik...@va...> - 2001-03-22 09:54:25
|
Date: Wed, 21 Mar 2001 14:22:56 -0600 (CST) From: "Robert W. Bill" <rb...@di...> >>=3D20 >> I've probably described things rather poorly. :) I do want to have = inner =3D and >> proper in the same place. But two servlets (i.e. 2 * 2 files), each runni=3D ng >> in it's own context, didn't seem to work. As if the first, when initializ=3D ed >> by the engine (Tomcat), somehow locks stuff that make Jython unable = to fi=3D nd >> the other servlet. >> It's a bizarre problem (if I for instance remove the first = servlet fr=3D om >> Tomcat initialization, the other is suddenly found). >> I'm too tired to dare try and explain further I'm afraid :); = I'll try=3D to >> produce a better analysis and description later (I don't even have access=3D to >> the machine right here.) >>=3D20 >> Hopefully; I haven't missed something obvious (since it's such a = strange >> problem). > >Ahhh, I did misunderstand before- ooops. Well, it may not help, >but I've witnessed jython servlets running in many contexts. >What is likely different is that these contexts were all=3D20 >self-contained. This means _each_ WEB-INF/lib folder has it's own >jython.jar (maybe that's why I haven't seen similar troubles?) It >seems reasonable to give this a try. For jythonc compiled files >it creates some troubles with python.home and finding the Lib >directory. org.python.util.PyServlet can help here because it >allows you to use web.xml to set properties, or you could try >freezing all the required modules into a jar also in each >WEB-INF/lib. (I never realized how much duplication this sounds >like until I tried describing it.) Ah, thank you; I will try this. If this is the problem, is this = something which might be fixed in upcoming versions of Jython, or is it an undefeatable effect?=A0It seems a little constraining not being able to = treat jython-originiated servlet-classes the same as regular serlvets. (Or am = I misunderstanding something?) Of course, I guess the procedings you advice here are probably how most things should be done in a "proper" setting. Thanks! / Niklas |
From: Jim A. <ji...@tr...> - 2001-03-21 23:35:37
|
Mark Ackerman wrote: > Now I get: > > Traceback (innermost last): > File "<string>", line 1, in ? > AttributeError: class 'Util' has no attribute 'test' > > for the method: > > public static int test(int a, int b) > { > return a*b; > } > > in the class Util. I assume your Python code says something like ?: from <mypackage> import Util result = Util.test(a, b) This should work if the types of 'a' and 'b' can be coerced into 'int's (although if they can't you would be getting a different error ?) Have you seen Bruce Eckel's chapter in the downloadable book 'Thinking in Patterns' that is all about using Python?: http://www.bruceeckel.com/TIPatterns/index.html Chapter 9 is the "Interpreter Pattern" and Jython. Near the end is 'Controlling Java from Jython' that has what you need..and lots more! -- __o Jim Adrig _ \<,_ ji...@tr... ' `/ ' ` ___________ `-' `-' |
From: Mark A. <ack...@mo...> - 2001-03-21 23:15:18
|
>First import your classes: > > from dsi.fs import FillFiller, Segment > >It's really toooo easy ! What problems are you having ? You gave me the first part of the magic. Now I get: Traceback (innermost last): File "<string>", line 1, in ? AttributeError: class 'Util' has no attribute 'test' for the method: public static int test(int a, int b) { return a*b; } in the class Util. |
From: Robert W. B. <rb...@di...> - 2001-03-21 20:19:01
|
[Niklas Lindstr=F6m] <snip> > >> 2. [Might be off-topic] > >> When running two servlets -- compiled from Jython-sources -- in two > >> different contexts under Tomcat, I run into problems. Tomcat cannot fi= nd > the > >> second servlet, unless I put its classes (regular + inner) in the same > >> context (i.e. in the same (WEB-INF/classes). At first, I thought it wa= s > due > >> to the "inner class"; but it seems that I have to move both in order f= or > the > >> servlet to be found. This does not seem to happen to regular > Java-servlets > >> though, which is why I wonder if it's a Jython-problem. > >> My question here is really if someone else has had any problems li= ke > >> this and has a suggestion at hand; otherwise, I will do some more > tracking > >> of the problem to see what I might have overlooked. > > > >I've only had success with the inner-class and class-proper in the same > >context. The good stuff in Servlet2.2 containers is the ease of making > >self-contained webapps, so I'm a bit confused about what the advantages = of > >defeating this feature would be. (or I misunderstood :) > > >=20 > I've probably described things rather poorly. :) I do want to have inner = and > proper in the same place. But two servlets (i.e. 2 * 2 files), each runni= ng > in it's own context, didn't seem to work. As if the first, when initializ= ed > by the engine (Tomcat), somehow locks stuff that make Jython unable to fi= nd > the other servlet. > It's a bizarre problem (if I for instance remove the first servlet fr= om > Tomcat initialization, the other is suddenly found). > I'm too tired to dare try and explain further I'm afraid :); I'll try= to > produce a better analysis and description later (I don't even have access= to > the machine right here.) >=20 > Hopefully; I haven't missed something obvious (since it's such a strange > problem). Ahhh, I did misunderstand before- ooops. Well, it may not help, but I've witnessed jython servlets running in many contexts. What is likely different is that these contexts were all=20 self-contained. This means _each_ WEB-INF/lib folder has it's own jython.jar (maybe that's why I haven't seen similar troubles?) It seems reasonable to give this a try. For jythonc compiled files it creates some troubles with python.home and finding the Lib directory. org.python.util.PyServlet can help here because it allows you to use web.xml to set properties, or you could try freezing all the required modules into a jar also in each WEB-INF/lib. (I never realized how much duplication this sounds like until I tried describing it.) cheers, Robert |
From: <nik...@va...> - 2001-03-21 19:23:38
|
Hi again. :) From: Robert W. Bill [mailto:rb...@di...] Sent: Wednesday, March 21, 2001 11:52 PM >On Wed, 21 Mar 2001, Niklas Lindstr=F6m wrote: >> 1. [see also (3)] >> Has anyone successfully used Jython in JSP? I recently discovered = the >> BSF-taglib from jakarta.apache.org, but that was quite limited in comparison >> with the ideal of exchanging the native Java for scripting with e.g. Jython. >> (I've considered PSP, but it's a little off-standard, and seems >> unattended..?) > >Yes. jythonc compiled files work in JSP just as if they were Java >classes. Additionally, Java classes, beans, and taglibs can embed the >org.python.util.PythonInterpreter. > That sounds great. How about performance in these cases; like for a = Bean written in Jython? Is there anything "official" out there that makes use of Jython in = JSP, other than that BSF-thing (which didn't seem to have a global scope..:/ = )? ----8<---- *snip* ---->8---- >> 3. [This is definitely off-topic in essence, but in practise, it = might well >> touch the roles of Jython (e.g. in JSP)] >> >> This is a somewhat controversial subject. In Webware's PSP >> (webware.sourceforge.net), there is an option to use braces instead = of >> indentation. This strikes me as a very good solution when embedding >> Python-code into "output" (text, HTML, XML etc). Therefore I wonder, since >> scripting capabilities in e.g. JSP and XSP (Cocoon) are likely to = follow >> "standard procedures of incorporation" (whatever that is), will = Jython (and >> Python) ever have this option? I would not like to see it anywhere = else than >> when embedding, but just there it makes sense. Maybe this is more up = to the >> implementation of the "server page to code" interpreter = though..(such as in >> Webware's PSP)? > >Adding braces does make it easier to terminate compound = statements/loops >when your mixing markup with Python/Jython. I'm skeptical about it >really being essential in JSP. Taglibs seem nicer. After all, = quality >JSP makes heavy use of useBean and taglibs so the amount of inline = code is >minimized anyway. I haven't used webware, but I'm guessing there is = not >an easy way to add xml tags that determine page logic. Without an >equivelant to taglibs, it would be more important to allow other ways = to >delineate code blocks. Am I mistaken? Does webware allow custom tag >definitions? I fully agree with you (actually, I'm a firm believer in logic/content/presentation-models; in a web-context preferably using = XSLT). But using taglibs for looping and tests seems somewhat superfluous (may = be a good idea though - I've done a thing like that for XML; inspired by = XSP:s taglibs). The situations are still there though, where embedding raw logic in presentation is the quickest (albeit dirtiest) way to build stuff. In = such cases, the indent-retraints may impose on both readability and firmness = when using Python. As for Webware, I'm not sure. I do know that they are to some extent inspired by the Jakarta-project; and that they provide a similar functionality as servlets and JSP. But I doubt the use of XML is as extensive. There seem to be quite some JSP-similarity though (more than = to ASP/PHP). >How does Python Server Pages (http://www.ciobriefings.com/psp/) = implement >this? I only get Zope errors at their site- is this no longer = available? I have the feeling that this is a somewhat inactive project. They use = an "end block" statement. I do not know if this is all, or if indent is = also used. Generally, I've seen the use of a special "end", or forcing = dedent using "pass". These solutions all seem shaky in embedded stuff though = (an explicit "no block scope with indent - use braces" would be more safe = here). Remark: is this discussion considered out of this list's context? Finally, I'll just mention that I've had great success in using Jython togeheter with Xalan's extension mechanism for XSLT. Just to spread the word. ;) regards Niklas |
From: <nik...@va...> - 2001-03-21 19:06:25
|
Hi Robert! I divided this thread in two. :) >> 2. [Might be off-topic] >> When running two servlets -- compiled from Jython-sources -- in two >> different contexts under Tomcat, I run into problems. Tomcat cannot find the >> second servlet, unless I put its classes (regular + inner) in the same >> context (i.e. in the same (WEB-INF/classes). At first, I thought it was due >> to the "inner class"; but it seems that I have to move both in order for the >> servlet to be found. This does not seem to happen to regular Java-servlets >> though, which is why I wonder if it's a Jython-problem. >> My question here is really if someone else has had any problems like >> this and has a suggestion at hand; otherwise, I will do some more tracking >> of the problem to see what I might have overlooked. > >I've only had success with the inner-class and class-proper in the same >context. The good stuff in Servlet2.2 containers is the ease of making >self-contained webapps, so I'm a bit confused about what the advantages of >defeating this feature would be. (or I misunderstood :) > I've probably described things rather poorly. :) I do want to have inner and proper in the same place. But two servlets (i.e. 2 * 2 files), each running in it's own context, didn't seem to work. As if the first, when initialized by the engine (Tomcat), somehow locks stuff that make Jython unable to find the other servlet. It's a bizarre problem (if I for instance remove the first servlet from Tomcat initialization, the other is suddenly found). I'm too tired to dare try and explain further I'm afraid :); I'll try to produce a better analysis and description later (I don't even have access to the machine right here.) Hopefully; I haven't missed something obvious (since it's such a strange problem). |
From: Robert W. B. <rb...@di...> - 2001-03-21 17:56:07
|
Hi Niklas, On Wed, 21 Mar 2001, Niklas Lindstr=F6m wrote: > 1. [see also (3)] > Has anyone successfully used Jython in JSP? I recently discovered the > BSF-taglib from jakarta.apache.org, but that was quite limited in compa= rison > with the ideal of exchanging the native Java for scripting with e.g. Jy= thon. > (I've considered PSP, but it's a little off-standard, and seems > unattended..?) Yes. jythonc compiled files work in JSP just as if they were Java classes. Additionally, Java classes, beans, and taglibs can embed the org.python.util.PythonInterpreter. > 2. [Might be off-topic] > When running two servlets -- compiled from Jython-sources -- in two > different contexts under Tomcat, I run into problems. Tomcat cannot fin= d the > second servlet, unless I put its classes (regular + inner) in the same > context (i.e. in the same (WEB-INF/classes). At first, I thought it was= due > to the "inner class"; but it seems that I have to move both in order fo= r the > servlet to be found. This does not seem to happen to regular Java-servl= ets > though, which is why I wonder if it's a Jython-problem. > My question here is really if someone else has had any problems lik= e > this and has a suggestion at hand; otherwise, I will do some more track= ing > of the problem to see what I might have overlooked. I've only had success with the inner-class and class-proper in the same context. The good stuff in Servlet2.2 containers is the ease of making self-contained webapps, so I'm a bit confused about what the advantages o= f defeating this feature would be. (or I misunderstood :) > 3. [This is definitely off-topic in essence, but in practise, it might = well > touch the roles of Jython (e.g. in JSP)] > > This is a somewhat controversial subject. In Webware's PSP > (webware.sourceforge.net), there is an option to use braces instead of > indentation. This strikes me as a very good solution when embedding > Python-code into "output" (text, HTML, XML etc). Therefore I wonder, si= nce > scripting capabilities in e.g. JSP and XSP (Cocoon) are likely to follo= w > "standard procedures of incorporation" (whatever that is), will Jython = (and > Python) ever have this option? I would not like to see it anywhere else= than > when embedding, but just there it makes sense. Maybe this is more up to= the > implementation of the "server page to code" interpreter though..(such a= s in > Webware's PSP)? Adding braces does make it easier to terminate compound statements/loops when your mixing markup with Python/Jython. I'm skeptical about it really being essential in JSP. Taglibs seem nicer. After all, quality JSP makes heavy use of useBean and taglibs so the amount of inline code i= s minimized anyway. I haven't used webware, but I'm guessing there is not an easy way to add xml tags that determine page logic. Without an equivelant to taglibs, it would be more important to allow other ways to delineate code blocks. Am I mistaken? Does webware allow custom tag definitions? How does Python Server Pages (http://www.ciobriefings.com/psp/) implemen= t this? I only get Zope errors at their site- is this no longer available? Regards, Robert |
From: Robert W. B. <rb...@di...> - 2001-03-21 16:02:01
|
Hello Wayne, On Wed, 21 Mar 2001, cindy wrote: > Hi, > I'm a little confude as to how to install jython. I pulled down the > tar-ball and untared it. Do I need to use ListOff to install it? > From what I read of ListOff, it sounded like I use this product to > bundle my classes. I'm using Blackdown distro of java 1.3.0. > My current release of python is 1.5.2. The CLASSPATH is > set to '/usr/local/jdk1.3/j2sdk1.3.0/bin. I installed jython > in /usr/local/jython-20010320. It appears you have downloaded the nightly CVS tarball instead of the Jython installer. That is why you see the "20010320" suffix to jython. You can use ant to build this if you want to be up-to-date. The build requires javacc found at http://www.metamata.com/javacc/ and ant found at http://jakarta.apache.org/builds/jakarta-ant/release/v1.3/. Just set the javaccHome2 property in build.xml or in the ant.property file and start ant in the same directory as build.xml. However, I suspect your were actually looking for an installer. If that is the case, visit http://jython.sourceforge.net/download.html and look for section "2. Downloading Jython". There is a "Download Jython 2.0" link to the installer in this section and that is much easier than building the cvs snapshot. Regards, Robert |
From: <nik...@va...> - 2001-03-21 15:40:08
|
Hi all, first of all (since I'm new to the list) I want to say thanks a lot for Jython; it's been extremely useful to me. Next, to the questions. (I'm sorry if some of this might be off-topic = for this list; but I figured it concerned Jython enough to include it.) = Here goes: 1. [see also (3)] Has anyone successfully used Jython in JSP? I recently discovered the BSF-taglib from jakarta.apache.org, but that was quite limited in = comparison with the ideal of exchanging the native Java for scripting with e.g. = Jython. (I've considered PSP, but it's a little off-standard, and seems unattended..?) 2. [Might be off-topic] When running two servlets -- compiled from Jython-sources -- in two different contexts under Tomcat, I run into problems. Tomcat cannot = find the second servlet, unless I put its classes (regular + inner) in the same context (i.e. in the same (WEB-INF/classes). At first, I thought it was = due to the "inner class"; but it seems that I have to move both in order = for the servlet to be found. This does not seem to happen to regular = Java-servlets though, which is why I wonder if it's a Jython-problem. My question here is really if someone else has had any problems = like this and has a suggestion at hand; otherwise, I will do some more = tracking of the problem to see what I might have overlooked. 3. [This is definitely off-topic in essence, but in practise, it might = well touch the roles of Jython (e.g. in JSP)] This is a somewhat controversial subject. In Webware's PSP (webware.sourceforge.net), there is an option to use braces instead of indentation. This strikes me as a very good solution when embedding Python-code into "output" (text, HTML, XML etc). Therefore I wonder, = since scripting capabilities in e.g. JSP and XSP (Cocoon) are likely to = follow "standard procedures of incorporation" (whatever that is), will Jython = (and Python) ever have this option? I would not like to see it anywhere else = than when embedding, but just there it makes sense. Maybe this is more up to = the implementation of the "server page to code" interpreter though..(such = as in Webware's PSP)? best regards Niklas Lindstr=F6m |