#!/usr/bin/wapptclsh # # Invoke as "tclsh test01.tcl" and then surf the website that pops up # to verify the logic in wapp. # if {[catch {package require wapp}]} { source [file dir [file dir [info script]]]/wapp.tcl } proc wapp-default {} { global wapp set B [wapp-param BASE_URL] set BX(y) $B set R [wapp-param SCRIPT_NAME] wapp-cache-control max-age=15 wapp "

Hello, World!

\n" wapp "
    " wapp-unsafe "
  1. Wapp Environment

    \n" wapp-subst {
  2. Environment using wapp-debug-env\n} wapp-subst {

  3. Full Environment\n} set crazy [lsort [wapp-param-list]] wapp-subst {

  4. } wapp "Environment with crazy URL\n" wapp-trim {

  5. Lint

  6. Deliberate error

  7. Encoding checks

  8. Redirect to env

  9. TCL global variables

  10. Content Security Policy

  11. File Upload Using multipart/form-data

  12. The source code to this script } set x "%string(...)" set v abc'def\"ghi\\jkl wapp-subst {

  13. %html($x) substitution test: "%string%($v)%"\n} wapp "
" if {[wapp-param-exists showenv]} { wapp-page-env } wapp-trim {

The creator of Wapp:
} } proc wapp-page-redirect {} { wapp-redirect env } proc wapp-page-globals {} { wapp-trim {

TCL Global Variables