%-- This is a PSP comment. It won't show up in the HTML or even in the class that this file will generate --%>
<%@ page imports = "sys,os,time"%><%-- Here's the modules that I need in this file. --%>
<%@ page imports = "PSP.Examples.PSPExamplePage" %>
<%@ page method="writeContent" %>
<%@ page extends="PSP.Examples.PSPExamplePage"%>
<%@ page indentType="braces" %>
<%-- Method declaration Test --%>
<%-- This image is served by WebKit --%>
This version of the test page uses braces as the indent type.
Read the PSP documentation. See the source for this page.
The text below comes from another psp page which was inserted into this one with the <%@ include %> directive.
<%@ include file="my_include.psp" %>
There are actually two ways to insert the contents of another file into a PSP page:
If you use <%@ include file="somefile" %>, it will effectively insert the contents of the other file before class creation time.
Using <psp:include path="somefile"> will insert the output of the specified WebKit URL into the page dynamically.
Time at which dynamic output was generated:
Loops are the trickiest part of PSP due to Python indentation for blocks syntax.
The uses of braces, while not good for normal Python, does make things easier here where we are dealing with HTML.
<%-- I still use indentation to make it easier to read. It just doesn't get passed through to Python. --%>| ' + info + ': ' ' | ' + str(value) + ' |
| ' 'This is not a Unix system. |
| Path Info: | <%=req.pathInfo()%> |
|---|---|
| extraURLPath: | <%=req.extraURLPath()%> |
| Fields: | <%= req.fields() %> |
| servletURI: | <%= req.servletURI()%> |
| uriWebKitRoot: | <%= req.uriWebKitRoot() %> |
| serverURL: | <%= req.serverURL() %> |
| serverURLDir: | <%= req.serverURLDir() %> |
| ' +str(i)+' | '
+self.request()._environ[i].replace(
',', ', |
PSP comments will not show up in the source of the page.
Nothing should be visible here.
<%-- Comment check --%><%-- # This kind not even in Python file created. --%>I\'m a method. %s
' % val)pass can be used to end a block, so test that it can be used by itself too!
<% pass %>If-Test: <%if 1: {%>It's True<% }else: { %>It's false<% }%>
That's all, folks.
<%= time.ctime(time.time())%>