
Defining Customized Server-Parsed HTML Tags
Chapter 3 Server-Parsed HTML Tags 119
<servlet>
<servlet-name> pparams </servlet-name>
<servlet-class> PrintPackage.PrintParams </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> pparams </servlet-name>
<url-pattern> /PrintParams </url-pattern>
</servlet-mapping>
You must also include any servlet initialization parameters in the web.xml file.
For legacy (iPlanet Web Server 4.x)servlets,the
code parameter specifies the
.class file for the servlet and is required. The codebase parameter is required if
theservletis not definedin the
servlets.properties file and the .class file is not
in the same directory as the HTML file containing the
<SERVLET> tag. Legacy
servlets must be configured in the default virtual server and do not require a
web.xml file.
For more information about creating servlets, see the Netscape Enterprise Server
Programmer’s Guide to Servlets.
Defining Customized Server-Parsed HTML Tags
In Enterprise Server 6.1, users can define their own server-side tags. For example,
you could define thetag
HELLO to invoke a function that prints “Hello World!” You
could have the following code in your
hello.shtml file:
When the browser displays this code, each occurrence of the
HELLO tag calls the
function.
<html>
<head>
<title>shtml custom tag example</title>
</head>
<body>
<!--#HELLO-->
</body>
</html>
Komentarze do niniejszej Instrukcji