
Embedding Servlets
118 Netscape Enterprise Server Programmer’sGuide • April 2002 (Draft)
Embedding Servlets
Enterprise Server 6.1 supports the <SERVLET> tagasintroducedbyJavaWeb
Server. This tag allows you to embed servlet output in an SHTML file. No
configuration changes are necessary to enable this behavior. If SSI and servlets are
both enabled, the
<SERVLET> tag is enabled.
The
<SERVLET> tag syntax is slightly different from that of other SSI commands; it
resembles the
<APPLET> tag syntax:
If the servlet is part of a web application, the
code parameter is required and other
parameters are ignored. The
code parameter must include:
• The value of the
url-pattern element defined in the web.xml file for the web
application. For more information about
web.xml, see the Servlet 2.2 API
specification:
http://java.sun.com/products/servlet/index.html
• The value of theuri attribute defined in the web-apps.xml file for the web
application. For more information about
web-apps.xml,seethe Netscape
Enterprise Server Programmer’s Guide to Servlets.
For example, if you wanted to include the following in your SHTML file:
<servlet name=pparams code="/PrintApp/PrintParams">
</servlet>
you would need to include the following in your web-apps.xml file:
<web-app uri="/PrintApp"
dir="/nes60/https-server.netscape.com/example.com/webapps/PrintApp"
/>
you would also need to include the following in your web.xml file:
<servlet name=name code=code codebase=path iParam1=v1 iParam2=v2>
<param name=
param1 value=v3>
<param name=
param2 value=v4>
.
.
</servlet>
Comentários a estes Manuais