Hi Jython developers,
I'm working on a minimalists' model-view-controller type of framework for
web development. Jython servlet is really great. I want to use Jython not
only on the view layer but also in the controller layer. The goal is to be
able to write each little action handler in Jython, in other words be able
to dispatch to Jython scripts and detect change on the fly. Simply following
the PyServlet code, I got it working without much difficulties.
But here are some small problems I'm having, no show stopper, just some
nice-to-have:
1) Now I have two interpreters in the same JVM, when the second one
initialize, it complains "trying to reinitialize with new properties" then
quits re-initializing. This is the correct behavior. However I am wondering
if it's possible:
* Either make PySystemState.initialized accessible, and change
PyServlet.java to check it before calling
PythonInterpreter.initialize(preProps, postProps). Of course I will change
the second initialization to do the same.
* Or simply remove the warning.
2) For 'python.home' setting, have PyServlet read servlet context parameters
in addition to servlet parameters. That way, in case of multiple
interpreters under the same servlet context, I only need to config
python.home once - just in the servlet context level configuration file.
3) Change the hard-coded requirement of Jython servlet using *.py suffix.
diff -r1.13 PyServlet.java
171c171
< int end = path.lastIndexOf(".py");
---
> int end = path.lastIndexOf('.');
Thanks for the great work,
-Brian
|