Leo Soto M. | 21 Jul 06:01

Some modjy questions/proposals

Hello list, and specially Alan Kennedy ;)

I have been playing with modjy the weekend and have two small
questions/proposals:

 1. I see that SCRIPT_NAME is directly set from getServletPath(). This
ignores the context path, which from what I understand from the WSGI
spec[1] ("The initial portion of the request URL's "path" that
corresponds to the application object, so that the application knows
its virtual "location""), should also be included. Also, looks like
the JRuby guys are also prepending the context root[2]. Or am I
missing something?

 2. What about having a predefined directory analogous to WEB-INF/lib,
but for python code (i.e, to get added on sys.path). How about
WEB-INF/lib-python?

This way, we could have the following hierarchy inside WAR files:
.
|-- WEB-INF
|   |-- classes
|   |-- lib
|   |   |-- jython.jar
|   |   |-- modjy.jar
|   |   `-- postgresql-jdbc3-8.2.jar
|   |-- lib-python
|   |   |-- django
|   |   |-- jython-lib.jar
|   |   `-- my_django_project
|   `-- web.xml
`-- application.py

Note that, as the entries of sys.path are also scanned by the Jython's
classloader, they will also be scanned for java classes, but
WEB-INF/lib/* won't be scanned for python modules. To me this feels
consistent with typical Jython behaviour.

Last but not least, getting modjy working has been quite easy, so I
want to thank Alan for his great work! I can't wait to see it included
into Jython itself :)

[1] http://www.python.org/dev/peps/pep-0333/
[2] http://github.com/nicksieger/jruby-rack/tree/e440ea1334dcf8a9ad540728278ed89d21ef4077/src/main/ruby/rack/handler/servlet.rb#L111
--

-- 
Leo Soto M.
http://blog.leosoto.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane