Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ns_puts(3aolserv) [debian man page]

ns_adp_puts(3aolserver) 				    AOLserver Built-In Commands 				   ns_adp_puts(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
ns_adp_append, ns_adp_close, ns_adp_dump, ns_adp_flush, ns_adp_puts, ns_adp_stream, ns_adp_tell, ns_adp_trunc, ns_puts - ADP output com- mands SYNOPSIS
ns_adp_append string ?string ...? ns_adp_close ns_adp_dump ns_adp_flush ns_adp_puts ?-nonewline? string ns_adp_stream ns_adp_tell ns_adp_trunc ?length? ns_puts ?-nonewline? string _________________________________________________________________ DESCRIPTION
These commands enable adding to and manipulation of the ADP output buffer. See ns_adp for an overview on ADP pages. ns_adp_append string ?string ...? This command appends one or more strings to the ADP output buffer. For the case of a single argument, it is equivalent to ns_adp_puts -nonewline string. ns_adp_close This command can be used to flush and close the underlying HTTP connection. ADP execution continues after the connection is closed; any text appended to the output buffer after the close is simply discarded when processing is complete. ns_adp_dump This command returns the text of the ADP buffer. ns_adp_flush This command flushes the contents of the ADP buffer to the current connection or file channel. It will raise a Tcl exception if the underlying flush failed, for example, if the HTTP connection is closed or the channel write failed. Flushed content is returned in "chunked-encoding" format if the HTTP protocol version is at least 1.1 (normally the case for all modern browsers). A call to ns_adp_flush is not normally needed except for specialized applications as all content is automatically flushed at the end of a con- nection or on buffer overflow. (see ns_adp_ctl bufsize for details on buffer mangement). ns_adp_puts ?-nonewline? string This function appends the specified string to the ADP buffer. Unless the optional -nonewline argument is used, a newline will be appended to the page after the string. Note that the argument to ns_adp_puts is a single string unlike ns_adp_append which takes a variable number of strings to append. ns_adp_stream This function begins streaming mode for the ADP. All data currently in the ADP output buffer is flushed and any subsequent data will be output directly to the connection. It is equivalent to an ns_adp_flush followed by an ns_adp_ctl bufsize 0. ns_adp_tell This function returns the total number of bytes current in the ADP buffer. A buffer overflow or direct call to ns_adp_flush will reset this counter to zero so the result of ns_adp_tell may not return the total number of bytes eventually sent. ns_adp_trunc ?length? This function can be used to truncate output buffer to the requested size. This can be useful to trim unintended white space or to clear a result and generate an error message. Note that content already streamed to the client, if any, cannot be truncated. ns_puts ?-nonewline? string This command is a deprecated name for ns_adp_puts. SEE ALSO
ns_adp(n), ns_adp_include(n) KEYWORDS
ADP, dynamic pages AOLserver 4.5 ns_adp_puts(3aolserver)

Check Out this Related Man Page

ns_adp_ctl(3aolserver)					    AOLserver Built-In Commands 				    ns_adp_ctl(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
ns_adp_ctl - ADP control command SYNOPSIS
ns_adp_ctl bufsize ?size? ns_adp_ctl chan channel ns_adp_ctl autoabort ?bool? ns_adp_ctl detailerror ?bool? ns_adp_ctl displayerror ?bool? ns_adp_ctl expire ?bool? ns_adp_ctl gzip ?bool? ns_adp_ctl nocache ?bool? ns_adp_ctl safe ?bool? ns_adp_ctl singlescript ?bool? ns_adp_ctl stricterror ?bool? ns_adp_ctl trace ?bool? ns_adp_ctl trimspace ?bool? _________________________________________________________________ DESCRIPTION
This command enables control of the current ADP execution environment. Aside from the bufsize and chan subcommands, they all return a boolean value for a given ADP option. If the bool argument is given, the option is set to the given value and the previous value is returned. ns_adp_ctl bufsize ?size? This command returns the currently ADP output buffer size, setting it to a new value if the optionial size argument is specified. ns_adp_ctl chan channel This command is used to specify an open file channel to receive output when the buffer is flushed. If channel is the null string, the output channel is cleared. This capability can be useful for specialized uses of ADP outside the context of an HTTP connection, e.g., for debugging or testing. ns_adp_ctl autoabort ?bool? Query or set the autoabort option. When enabled, failure to flush a buffer (normally the result of a closed HTTP connection) gener- ates an ADP exception, unwinding the ADP call stack. ns_adp_ctl detailerror ?bool? Query or set the detailerror option. When enabled, errors in ADP pages are formatted with information about the context of the HTTP request. This can be very helpful in debugging ADP errors but potentially a security risk if the HTTP context (e.g., cookie head- ers) contains personal or sensitive data. Errors are logged to the server log and, if displayerror is enabled, appened to the out- put buffer. ns_adp_ctl displayerror ?bool? Query or set the displayerror option. When enabled, errors in ADP pages are formatted and appended to the output stream, normally visiable to a user's browser. This option should generally be enabled in development and disabled in production. ns_adp_ctl expire ?bool? Query or set the expire option. When enabled, the ADP request processing code adds an "Expires: now" header in the response buffer to disable any caching. In practice, more thoughtful cache control mechanisms should be used based on the HTTP/1.1 spec. ns_adp_ctl gzip ?bool? Query or set the gzip option. When enabled, the output buffer is compressed before being returned in the response. As ADP's are generally used to generate text data such as HTML or XML, compression is normally quite successful at reducing the response size. ns_adp_ctl nocache ?bool? Query or set the nocache option. When enabled, all requests to cache executed ADP blocks via the ns_adp_include -cache directive are ignored, resulting in normal execution of all code. ns_adp_ctl safe ?bool? Query or set the safe option. When enabled, all code is executed in "safe" mode, disabling and ignoring any code within <% regis- tered tags. ns_adp_ctl singlescript ?bool? Query or set the singlescript option. When enabled, ADP pages are converted from independent text-script blocks into a single script, which text blocks replaced with a call to ns_adp_append with the given text. Functionally the output is the same however an error anywhere on the page will result in the entire ADP page returning instead of skipping to the next block which is the normal behavior. In practice, singlescript is useful in development while in production leaving it disabled provides a more defensive exe- cution environment where minor errors in one ADP do not inhibit execution of the overall page. ns_adp_ctl stricterror ?bool? Query or set the stricterror option. When enabled, the result is similar to that of singlescript in that an error in a particular block will return the entire page instead of continuing to the next text or script block. ns_adp_ctl trace ?bool? Query or set the trace option which currently does nothing. ns_adp_ctl trimspace ?bool? Query or set the trimspace option. When enabled, any white space at the start of the output buffer is eliminated. White space can show up in the output as a result of ADP pages which do nothing but include other ADP's in a way to reuse code with the unfortunate side effect of the training newline at the end of a "<% ns_adp_include myfile.adp %>" ending up in the output stream. SEE ALSO
ns_adp(n), ns_adp_flush(n), ns_adp_close(n), ns_adp_mimetype(n) KEYWORDS
ADP, dynamic pages, buffer AOLserver 4.5 ns_adp_ctl(3aolserver)
Man Page