Hi Jython Users,


I am trying to create a medium complexity servlet based web-app .
This webapp is a kind of diagnostic application that will query the status of various java services deployed in the particular server. There are quite a few services and I may plan to write one servlet for each service. I also want to organize the jython servlets in packages, just like we do with the java servlet code.

I read up the documentation given @ http://www.jython.org/jythonbook/en/1.0/SimpleWebApps.html

To me, it seems that the PyServlet example will only work if we directly invoke the .py in the URL .  The URL will be something like 
hostname:port/context-root/NewJythonServlet.py

If that is the case , why does the example ask us to add the servlet mapping in Listing 13-2 (of the link given above)?

Is it possible to invoke the NewJythonServlet by hitting a url like :

hostname:port/context-root/NewJythonServlet ?

The organization of the code in the final war is :

JythonWebApp
--WEB-INF
-- web.xml
-- glassfish-web.xml
----lib
------jython.jar
----classes
TestJython.py
index.jsp

and web servlet mapping is :

<servlet>
    <servlet-name>PyServlet</servlet-name>
    <servlet-class>org.python.util.PyServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>PyServlet</servlet-name>
    <url-pattern>*.py</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>TestJython</servlet-name>
    <servlet-class>TestJython</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>TestJython</servlet-name>
    <url-pattern>/TestJython</url-pattern>
</servlet-mapping>


In other parts of the documentation : http://www.jython.org/jythonbook/en/1.0/DeploymentTargets.html
There is a discussion about using PlyJy and some PlyJy servlets. But I don't want to go down that path.

So, is it possible to invoke the jython servlet by hitting a "non-py" URL, as asked above ? What do we need to do achieve that ?

I apologize if I overlooked something mentioned in the document or something that is very obvious to a servlet expert. 


Regards,
Debabrata Pani