![Netscape ENTERPRISE SERVER 6.1 Скачать руководство пользователя страница 229](http://html1.mh-extra.com/html/netscape/enterprise-server-6-1/enterprise-server-6-1_manual_1674653229.webp)
Service Example
Chapter
6
Examples of Custom SAFs
229
Installing the Example
To load the shared object containing your functions add the following line in the
Init
section of the
magnus.conf
file:
To call the
simple-service-init
function to initialize the message representing
the generated output, add the following line to the
Init
section in
magnus.conf
.
(This line must come after the one that loads the library containing
simple-service-init
).
To execute the custom SAF during the request-response process for some object,
add the following line to that object in the
obj.conf
file:
Service type="text/html" fn=simple-service
The
type="text/html"
argument indicates that this function is invoked during
the
Service
stage only if the
content-type
has been set to
text/html
.
Source Code
#include <nsapi.h>
static char *simple_msg = "default customized content";
/* This is the initialization function.
* It gets the value of the generated-output parameter
* specified in the Init directive in magnus.conf
*/
NSAPI_PUBLIC int init-simple-service(pblock *pb, Session *sn,
Request *rq)
{
/* Get the message from the parameter in the directive in
Init fn=load-modules shlib=
yourlibrary
funcs=simple-service-init,simple-service
Init fn=simple-service-init
generated-output="<H1>
Generated output msg
</H1>"
Содержание ENTERPRISE SERVER 6.1
Страница 1: ...NSAPI Programmer s Guide Netscape Enterprise Server Version6 1 April 2002 Draft...
Страница 18: ...Where to Find Related Information 18 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 138: ...CGI to NSAPI Conversion 138 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 214: ...NSAPI Functions in Alphabetical Order 214 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 290: ...Miscellaneous 290 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 310: ...The Netscape LDAP Schema 310 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 318: ...cinfo 318 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 324: ...Sample MIME Types File 324 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 336: ...Buffered Streams 336 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 344: ...344 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 350: ...350 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 356: ...356 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...