|
From: <bc...@wo...> - 2001-02-08 21:49:28
|
[Brian Zhou]
>> >You could add getServletContext().getRealPath("/") to sys.path in
>PyServlet
>> >in the constructor.
>>
>> A good idea. That should take care of most issues with the application
>> part of sys.path.
>
>Does that mean servlet.py will import module (a non-servlet helper
>python module) from <context>/module.py? Why not add
>contextRoot/WEB-INF/classes to sys.path instead? I know module.py is not
>really a java class, but at least it's invisible from browser client.
>
>Where should I really put this module.py? <context>/WEB-INF/lib/ or
><context>/WEB-INF/classes/?
It's a good question (meaning that I don't have a good answer). In
addition to <context>/, the <context>/WEB-INF/lib/Lib is also included
on sys.path, but non of these places are good for the type of python
modules that must be invisible from browser client.
The ../lib and ../classes directories both have a well defined meaning
already, so I don't think that they are good candidates for sys.path
entries.
<context>/WEB-INF/modules/ perhaps?
regards,
finn
|