
<%@ page imports = "sys,os,time"%>
<%@ page method="writeHTML" %>
<%@ page extends="Page"%>



<HTML>
<BODY bgcolor='white'>
<h1 align=center><font color='blue'  face='helvetica'>Hello from PSP!</font></h1><br><br>

<center>This is the sample page for an implmentation of Python Server Pages.</center><br>
<br>
<p>The syntax for Python Server Pages is almost identical to that of Java Server Pages (JSP).  Just the scripting language is different! And obviously better.  In fact, just about anything you can do with JSP, you can do with PSP, and more.  The only thing the current implementation is missing is Beans, and we'll top that shortly.  In the meantime, with PSP, not only can you create template text that will be inerted in one method when the page is run as a servlet, but you can choose which base class to inherit from, you can choose which method of the base class to over-ride with your template text, and you can add additional methods to the servlet class, all from the PSP template code.
<p>
<p>I know, Cool, huh?

<br><br>
The text below comes from another jsp page which was inserted into this one with the &lt%@ incude %> directive.
<p>


<font color="red">
<%@ include file="my_include.psp" %>
</font>
<p>
<p>There are two ways to insert the contents of another file into a PSP page.  use &lt%@ include file="somefile" %&gt will effectively insert the contents of the other file before class creation time.<br>
Using &lt psp:include page="somefile"/&gt will insert the file into the page <i>after</i> page creation.  In other words, the file won't be parsed for jsp codes.  It'll just be output as is in the response stream.  (I haven't finalized this yet, so don't use it.)
<p>


<B> I've got a problem.  The included are getting spit out in the wrong order. I'm not flushing output somewhere. Shit.  Hey, I think I got it.</B>


<font color="blue">
<%--This actually works  <psp:include page = "/other/data/Linux/python/Webware/WebKit/Examples/APSPinclude.html"> --%>
</font>


<b>Below is a loop test</b>


<% for i in range(5): %>
<% for n in range(5): %>
<p><i> Number is <%= i %>, and <%= n %> </i>
<% pass %>
<% pass %>



<table bgcolor = 'blue'>
<%if hasattr(os, 'uname'):
	info = os.uname()
else:
	info = (sys.platform, 'node', 'release', 'version', 'machine')
for i in info:
	res.write('<tr><td><font color="white">'+str(i)+'</font></td></tr>')
res.write('<tr><td>'+req.pathInfo()+'</td></tr>')
%>
</font>
</table>
<br><%=  time.ctime(time.time())%>
<%-- Comment check --%>
<!-- Comment Check -->

<psp:method name="testing" params="val">
self._response.write('<br>boo\n')
self._response.write(val)
</psp:method>

<%self.testing('value')%>

<% pass %>
</BODY>
</HTML>

