NSAPI Developer's Guide

Searching Sun Java System Web Server Documentation

                           Table of Contents



                               Top Contributors


   

UserEditsComments
s_aby 1390
Sudha.Bhat 230

Sun Java System Web Server 7.0 Update 5 NSAPI Developer's Guide

This guide discusses how to use Netscape Server Application Programmer's Interface (NSAPI) to build plug-ins that define Server Application Functions (SAFs) to extend and modify Sun Java System Web Server 7.0. The guide also provides a reference of the NSAPI functions you can use to define new plug-ins.

About NSAPI

This chapter provides an overview of the Netscape Server API (NSAPI).

Creating Custom Server Application Functions

This chapter describes how to write your own NSAPI plug-ins that define custom Server Application Functions (SAFs). The ability to create custom plug-ins enables you to modify or extend the Sun Java System Web Server’s built-in functionality. For example, you can modify the server to handle user authorization in a special way or generate dynamic HTML pages based on information in a database.

This chapter has the following sections:

Before writing custom SAFs, you must familiarize yourself with the request-handling process, as described in detail in the Sun Java System Web Server Administrator's Configuration File Reference. Also, before writing a custom SAF, check to see whether a built-in SAF already accomplishes the tasks you have in mind.

See Appendix B: Alphabetical List of NSAPI Functions and Macros for a list of the predefined Init SAFs. For information about predefined SAFs used in the obj.conf file, see the Sun Java System Web Server Administrator's Configuration File Reference.

For a complete list of the NSAPI routines for implementing custom SAFs, see NSAPI Function and Macro Reference.

                                                                                                                                                                                                                                      [Back to top]

Creating Custom Filters

This chapter describes how to create custom filters that can be used to intercept and possibly modify the content presented to or generated by another function.

This chapter has the following sections:

Examples of Custom SAFs and Filters

This chapter provides examples of custom Sever Application Functions (SAFs) and filters for each directive in the request-response process. You can use these examples as the basis for implementing your own custom SAFs and filters. For more information about creating your own custom SAFs, see Creating Custom Server Application Functions. For information about creating your own filters, see Creating Custom Filters.

Before writing your own SAF, check to see whether an existing SAF serves your purpose. The predefined SAFs are discussed in the Sun Java System Web Server Administrator's Configuration File Reference.

If you need to writer a custom SAF, you should be familiar with the request-response process and the role of the configuration file obj.conf. See the Sun Java System Web Server Administrator's Configuration File Reference for information on the obj.conf file.

For a list of the NSAPI functions for creating new SAFs, see NSAPI Function and Macro Reference.

This chapter has the following sections:

Creating Custom Server-Parsed HTML Tags

This chapter describes the procedure to create custom server-parsed HTML tags. This chapter contains the following section:

                                                                                                                                                                                                                                      [Back to top]

NSAPI Function and Macro Reference

This chapter lists all the public C functions and macros of the Netscape Server Applications Programming Interface (NSAPI). Use these functions when writing your own Server Application Functions (SAFs) and filters.

Each function provides the name, syntax, parameters, return value, a description of what the function does, and sometimes an example of its use and a list of related functions.

For more information on data structures, see Data Structure Reference.

For an alphabetical list of function names, see Appendix B: Alphabetical List of NSAPI Functions and Macros.

                   C & D
                          F
                   I, L, M & N
       Macros
  • CALLOC() Macro
     
    Functions
  • cinfo_find() Function
  • condvar_init() Function
  • condvar_notify() Function
  • condvar_terminate() Function
  • condvar_wait() Function
  • crit_enter() Function
  • crit_exit() Function
  • crit_init() Function
  • crit_terminate() Function
  • daemon_atrestart() Function
       Macros
  • FREE() Macro
     
    Functions
  • fc_close() Function
  • fc_open() Function
  • fc_net_write() Function
  • filebuf_buf2sd() Function
  • filebuf_close() Function
  • filebuf_getc() Function
  • filebuf_open() Function
  • filebuf_open_nostat() Function
  • filter_create() Function
  • filter_find() Function
  • filter_insert() Function
  • filter_layer() Function
  • filter_name() Function
  • filter_remove() Function
  • flush() Function
  • func_exec() Function
  • func_find() Function
  • func_insert() Function
       Macros
  • MALLOC() Macro
  • NSAPI_RUNTIME_VERSION() Macro
  • NSAPI_VERSION() Macro
     
    Functions
  • insert() Function
  • log_error() Function
  • net_flush() Function
  • net_ip2host() Function
  • net_read() Function
  • net_sendfile() Function
  • net_write() Function
  • netbuf_buf2sd() Function
  • netbuf_close() Function
  • netbuf_getbytes() Function
  • netbuf_getc() Function
  • netbuf_grab() Function
  • netbuf_open() Function
  • nsapi_module_init() Function
                       P & R
                      S & U
                             V
           W
       Macros
  • PERM_CALLOC() Macro
  • PERM_FREE() Macro
  • PERM_MALLOC() Macro
  • PERM_REALLOC() Macro
  • PERM_STRDUP() Macro
  • REALLOC() Macro
     
    Functions
  • param_create() Function
  • param_free() Function
  • pblock_copy() Function
  • pblock_create() Function
  • pblock_dup() Function
  • pblock_find() Function
  • pblock_findval() Function
  • pblock_free() Function
  • pblock_nninsert() Function
  • pblock_nvinsert() Function
  • pblock_pb2env() Function
  • pblock_pblock2str() Function
  • pblock_pinsert() Function
  • pblock_remove() Function
  • pblock_str2pblock() Function
  • prepare_nsapi_thread() Function
  • protocol_dump822() Function
  • protocol_set_finfo() Function
  • protocol_start_response() Function
  • protocol_status() Function
  • protocol_uri2url() Function
  • protocol_uri2url_dynamic() Function
  • read() Function
  • remove() Function
  • request_get_vs() Function
  • request_header() Function
  • request_stat_path() Function
  • request_translate_uri() Function
       Macros
  • STRDUP() Macro
  • USE_NSAPI_VERSION() Macro
     
    Functions
  • sendfile() Function
  • session_dns() Function
  • session_maxdns() Function
  • shexp_casecmp() Function
  • shexp_cmp() Function
  • shexp_match() Function
  • shexp_valid() Function
  • system_errmsg() Function
  • system_fclose() Function
  • system_flock() Function
  • system_fopenRO() Function
  • system_fopenRW() Function
  • system_fopenWA() Function
  • system_fread() Function
  • system_fwrite() Function
  • system_fwrite_atomic() Function
  • system_gmtime() Function
  • system_localtime() Function
  • system_lseek() Function
  • system_rename() Function
  • system_ulock() Function
  • system_unix2local() Function
  • systhread_attach() Function
  • systhread_current() Function
  • systhread_getdata() Function
  • systhread_newkey() Function
  • systhread_setdata() Function
  • systhread_sleep() Function
  • systhread_start() Function
  • systhread_timerset() Function
  • util_can_exec() Function (UNIX Only)
  • util_chdir2path() Function
  • util_cookie_find() Function
  • util_env_find() Function
  • util_env_create() Function
  • util_env_free() Function
  • util_env_replace() Function
  • util_env_str() Function
  • util_getline() Function
  • util_hostname() Function
  • util_is_mozilla() Function
  • util_is_url() Function
  • util_itoa() Function
  • util_later_than() Function
  • util_sh_escape() Function
  • util_snprintf() Function
  • util_sprintf() Function
  • util_strcasecmp() Function
  • util_strftime() Function
  • util_strncasecmp() Function
  • util_uri_escape() Function
  • util_uri_is_evil() Function
  • util_uri_parse() Function
  • util_uri_unescape() Function
  • util_vsnprintf() Function
  • util_vsprintf() Function
       Functions
  • vs_alloc_slot() Function
  • vs_get_data() Function
  • vs_get_default_httpd_object() Function
  • vs_get_doc_root() Function
  • vs_get_httpd_objset() Function
  • vs_get_id() Function
  • vs_get_mime_type() Function
  • vs_lookup_config_var() Function
  • vs_register_cb() Function
  • vs_set_data() Function
  • vs_translate_uri() Function
       Functions
  • write() Function
  • writev() Function

                                                                                                                                                                                                                                      [Back to top]

Data Structure Reference

NSAPI uses many data structures that are defined in the nsapi.h header file, which is in the install-dir/include directory.

This chapter describes public data structures in nsapi.h.

Note -
The data structures in nsapi.h that are not described in this chapter are considered private and could change incompatibly in future releases. Some of the data structures described in this chapter might contain additional, undocumented fields. These fields are also considered private and might change incompatibly in future releases. Additional fields may be added in future release, so do not make assumptions regarding the size of data structures.

This chapter has the following section:

Dynamic Results Caching Functions

The functions described in this chapter enables you to write a results caching plug-in for Sun Java System Web Server. A results caching plug-in, which is a Service SAF, caches data, a page, or part of a page in the web server address space, which the Web Server can refresh periodically on demand. An Init SAF initializes the callback function that performs the refresh.

This chapter has the following sections:

Appendix A: Hypertext Transfer Protocol

The Hypertext Transfer Protocol (HTTP) is a protocol which is a set of rules that describes how information is exchanged, that enables a client such as a web browser and a Web Server to communicate with each other.

HTTP is based on a request-response model. The browser opens a connection to the server and sends a request to the server. The server processes the request and generates a response, which it sends to the browser. The server then closes the connection.

This chapter provides a short introduction to a few HTTP basics. For more information on HTTP, see the IETF home page at http://www.ietf.org/home.html.

This chapter has the following section:

Appendix B: Alphabetical List of NSAPI Functions and Macros

This appendix provides an alphabetical list for the easy lookup of NSAPI functions and macros.

                                                                                                                                                                                                                                      [Back to top]

Labels

java java Delete
server server Delete
sun sun Delete
webserver webserver Delete
system system Delete
webtier webtier Delete
guide guide Delete
developers developers Delete
webserver70 webserver70 Delete
developersguide developersguide Delete
sunjava sunjava Delete
nsapi nsapi Delete
nsapidevelopersguide nsapidevelopersguide Delete
web web Delete
+nsapiguide +nsapiguide Delete
nsapiguide nsapiguide Delete
application application Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Sign up or Log in to add a comment or watch this page.


The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact