from javax.servlet.http import HttpServlet class hello(HttpServlet): def doGet(self, req, res): res.setContentType("text/html"); out = res.getOutputStream() print >>out, "" print >>out, "in web.xml for the PyServlet context:Hello World, How are we? " print >>out, "Hello World, how are we?" print >>out, "" print >>out, "" out.close()
<web-app> <servlet> <servlet-name>PyServlet</servlet-name> <servlet-class>org.python.util.PyServlet</servlet-class> <init-param> <param-name>python.home</param-name> <param-value>/usr/home/jython-2.5</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>PyServlet</servlet-name> <url-pattern>*.py</url-pattern> </servlet-mapping> </web-app>
|
|
|
|
|
|