The pse module is a package that contains some useful functions and variables that are necessary for PSE servlets to run. Additionally, it contains the plugins package that contains all the plugin modules, and the tags module that contains any custom tag classes.
Cached output is stored in the directory specified by the
OutputCacheDir parameter in pse.conf. By default, this
is fileTMPDIR/pse_cache (where TMPDIR is your system's default
temporary file location).
OutputCacheDir directory specified
in the pse.conf file. PSE will attempt to create this
directory if it does not exist.
| filename, [name = value, ...]) |
Any output produced by the external servlet is returned by the call function, so the proper syntax should be:
<?=pse.call('filename.pt', name1 = value1, name2 = value2) ?>
IncludePath
parameter in the pse.conf file. Any path information provided
in the filename parameter will be ignored.
New in version 3.0.
| ) |
New in version 3.0.
pse.plugins.request.form.
pse.plugins.request.form
instead of pse.form in your code, since form will no
longer appear in the pse module in future versions of
PSE. See section 5.2.3 for more information.
| filename) |
Any output produced by the external servlet is returned by the include function, so the proper syntax should be:
<?=pse.include('filename.pt') ?>
IncludePath
parameter in the pse.conf file. Any path information provided
in the filename parameter will be ignored.
New in version 1.2.
Changed in version 2.0.
New in version 2.0.
| [encoding]) |
DefaultEncoding parameter in the
pse.conf file for the currently running servlet. The
encoding is specified using a valid encoding string. If
encoding is omitted, the encoding will revert to the
DefaultEncoding specified in the pse.conf file.
New in version 3.0.
| value) |
DefaultEncoding specified in the
pse.conf file (or changed by calling
pse.setencoding). In compiled servlets, expressions
used in the <?=expression ?> construct gets passed through
pse.str before being sent to the client as output via
a pse.write call.
When explicitly producing output to the client, whether through
pse.write or via sys.stdout or print, you
should use the pse.str function to normalize client
output. This is good practice in any case, since pse.str
may do more work for you in future versions of PSE.
New in version 3.0.
TagHooksModule
option in the pse.conf file. Normally all custom tag classes
are available in the global namespace of the servlet, however if you
want to be able to access the classes in modules that you import, they
can be referenced here.
Any external modules that want to access the custom tags must import this module, using one of the following examples or something similar:
import pse.tags from pse import tags from pse.tags import *
The form used will determine how the local namespace is affected by the import. The last form shown above is normally used, since the pse.tags module contains only the custom tag classes that were defined by the progammer.
| output) |
sys.stdout or print.
While those methods can be used to send output (most Python library modules use them), it will always be safer for your servlet to call pse.write instead, since pse.write may do more work for you in future versions of PSE
New in version 3.0.