From: <Ale...@di...> - 2002-03-24 18:32:24
|
I was just looking at the examples of JythonServlet, and I was wondering: why would you want to use jython to create the servlet, instead of using java ? I mean that it doesn't save you any of the steps that you have to go through when creating a java servlet, but rather you just have to use python syntax to accomplish the stuff that you otherwise would do in java (which sometimes feels a little awkward: to type java code, with the java libraries etc. with python syntax) . I love the integration of Jython and Java, and I like that I can do stuff (e.g. using all the java libs in jython, extending ) that I otherwise wouldn't be able to do in CPython (since I am not much into C++ -> I could read it but I doubt I could produce anything beyond basic stuff ) , but I didn't see the value that jython adds to a servlet. Would anybody give me a perspective on this ? Thanks, Alex Kotchnev Diversified Information Technologies |
From: Syver E. <syv...@on...> - 2002-03-24 22:31:31
|
Ale...@di... writes: > I was just looking at the examples of JythonServlet, and I was > wondering: > > why would you want to use jython to create the servlet, instead of > using java ? Hmm, let's say you know how to use python, have python libraries that you know, and just plain like to program in python. But, your project is to be deployed on the java platform, so you use jython because that is python for the java platform. If the platform was win32 you'd use python for windows, if it was AS/400 you'd use python for AS/400 etc., etc. If you'd like to write your application in another language than python for a specific application platform, than you do that instead. Ok? -- Vennlig hilsen Syver Enstad |
From: Brian Z. <bri...@us...> - 2002-03-25 01:45:12
|
First of all, Jython/Python is so much easier to write and __read__. When you use Java's collection, that part of the Java code pretty much degenerate to dynamic typing. JythonServlet runs under the jython interpreter. PyServlet takes care of caching and reloading. So as soon as you change your jython servlet code, it's reflected on the page. This at least saves a compilation and java .class reloading step. Jython can use both java API and most python libraries. I once ported a wiki implementation from CPython CGI to Jython, very straightforward. It determines one method to invoke during runtime, and dynamically evaluate it. I don't think using Java servlet would be as easy. You can argue JSP also provides automatic compilation and reloading. True. But, 1. JythonServlet only needs JRE to run 2. It can achieve the same result of model one JSP without the need of a specialized embedded language (JSP) 3. With the combination of XMLC, it can achieve even better code/markup separation than model two JSP (taglib)! Think about it, do you prefer logic/iteration tags in the markup, or python for loop and list comprehension? The performance may not be as good as Java Servlet, but you can always optimize the performance critical part in Java. I often wonder why Jython Servlet hasn't caught on - IMO it's mainly because the developer need to understand 1) Java 2)Java servlet 3) Python, and realize the advantage of this combination. -Brian Zhou ----- Original Message ----- From: <Ale...@di...> To: <jyt...@li...> Sent: Sunday, March 24, 2002 10:31 AM Subject: [Jython-users] JythonServlet over Java Servlet > I was just looking at the examples of JythonServlet, and I was wondering: > why would you want to use jython to create the servlet, instead of using > java ? I mean that it doesn't save you any of the steps that you have to go > through when creating a java servlet, but rather you just have to use > python syntax to accomplish the stuff that you otherwise would do in java > (which sometimes feels a little awkward: to type java code, with the java > libraries etc. with python syntax) . > > I love the integration of Jython and Java, and I like that I can do stuff > (e.g. using all the java libs in jython, extending ) that I otherwise > wouldn't be able to do in CPython (since I am not much into C++ -> I could > read it but I doubt I could produce anything beyond basic stuff ) , but I > didn't see the value that jython adds to a servlet. > > Would anybody give me a perspective on this ? > > > Thanks, > > Alex Kotchnev > Diversified Information Technologies > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Michel P. <mi...@di...> - 2002-03-26 10:58:26
|
> 3. With the combination of XMLC, it can achieve even better code/markup > separation than model two JSP (taglib)! Think about it, do you prefer > logic/iteration tags in the markup, or python for loop and list > comprehension? I will be making an alpha release soon of Zope Page Templates for Jython. For those of you who don't know, ZPTs are like XMLC except that they are much more "pythonic" and dynamic (the core PT engine was written by Guido and others at Pythonlabs and ZC). I'm just chasing down one bug right now and then I'll share; hopefully ZC will include my patches in their Page Templates so I don't have to maintain a fork. > optimize the performance critical part in Java. I often wonder why Jython > Servlet hasn't caught on - IMO it's mainly because the developer need to > understand 1) Java 2)Java servlet 3) Python, and realize the advantage of > this combination. A big problem, I think, is that the servlet API is very low level; when Python programmers want something high level where they can just plug simple components into a framework and see those components added to their website. The Servlet API is much to low-level to do that; servlets programmers need to worry about protcol details and other HTTP stuff. Zope is kind of like this for CPython programmers, but it's not very simple. Writing Zope extensions requires quite a bit of knowledge about Zope-only details. Zope tries to abstract the protocol (read "CGI") primarily with a mechanism called "object publishing". An object publisher servlet would be pretty easy to write, and it may even be possible to use the old Zope kernel "bobo" to do the publishing work and just wrap it in a servlet. -Michel |
From: Brad C. <bk...@mu...> - 2002-03-26 15:53:40
|
On 26 Mar 2002 at 4:55, Michel Pelletier wrote: > I will be making an alpha release soon of Zope Page Templates for > Jython. For those of you who don't know, ZPTs are like XMLC except > that they are much more "pythonic" and dynamic (the core PT engine > was written by Guido and others at Pythonlabs and ZC). I'm just > chasing down one bug right now and then I'll share; hopefully ZC will > include my patches in their Page Templates so I don't have to maintain > That will be wonderful! Brad Clements, bk...@mu... (315)268-1000 http://www.murkworks.com (315)268-9812 Fax AOL-IM: BKClements |
From: Brian Z. <bri...@us...> - 2002-03-25 04:39:13
|
You don't have to use the full-blown Enhydra. Here's a hello world example I made quite a while ago using standalone XMLC: http://jywiki.sourceforge.net/index.php?JythonServletXmlc The best source available is the "Enhydra XMLC" book, ISBN 0672322110. It could be a little tricky for the setup if you're using JDK1.4. But once setup, it works like a charm. http://xmlc.enhydra.org and the corresponding mailing list has setup instruction and tips. Ask on xmlc mailing list for xmlc related questions, ask any jython related question here. Regards, -Brian ----- Original Message ----- From: "BillWorker 2i" <bil...@in...> To: "Brian Zhou" <bri...@us...> Sent: Sunday, March 24, 2002 7:26 PM Subject: Re: [Jython-users] JythonServlet over Java Servlet > > 3. With the combination of XMLC, it can achieve even better code/markup > > separation than model two JSP (taglib)! Think about it, do you prefer > > logic/iteration tags in the markup, or python for loop and list > > comprehension? > > > Any examples, tutorials on XMLC and Jython? I don't want to do a full > Enhydra stuff! > > Ashish > |
From: Brad C. <bc...@vi...> - 2002-03-26 03:03:03
|
Has anyone here successfully modified bsf.jar to work with jython instead of jpython? Could you provide a copy? The instructions at http://www.lonsteins.com/articles/jython-bsf.html didn't take for some reason: "py" still not recognized, with jython.jar and the modified bsf.jar in my application's WEB-INF/lib. Might the problem be a class loader conflict with bsf.jar in tomcat's lib? Will check tomorrow. -- Brad Cox, PhD; bc...@vi... 703 361 4751 o For industrial age goods there were checks and credit cards. For everything else there is http://virtualschool.edu/mybank o Java Interactive Learning Environment http://virtualschool.edu/jile o Java Web Application Architecture: http://virtualschool.edu/jwaa |
From: Syver E. <syv...@on...> - 2002-03-26 12:30:55
|
Brad Cox <bc...@vi...> writes: > Has anyone here successfully modified bsf.jar to work with jython > instead of jpython? Could you provide a copy? > > The instructions at > > http://www.lonsteins.com/articles/jython-bsf.html > I just went with Robert Bill, he has alrady done this and has the files on his supporting web site for his book about Jython. http://www.digisprings.com/jython/BSF.html If you are serious about jython, get the book. Helped me a lot with avoiding programing by accident with jython by helping me understand the interaction between java and jython. -- Vennlig hilsen Syver Enstad |