ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahh_5.4.0.1/htmserv.htm

71 lines
4.2 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="HTMLServlet class" />
<meta name="abstract" content="" />
<meta name="description" content="" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="htmserv" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>HTMLServlet class</title>
</head>
<body id="htmserv"><a name="htmserv"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">HTMLServlet class</h1>
<div><p></p>
<div class="section"><p>The <a href="javadoc/com/ibm/as400/util/html/HTMLServlet.html">HTMLServlet</a> class represents a server-side
include. The servlet object specifies the name of the servlet and, optionally,
its location. You may also choose to use the default location on the local
system. </p>
<p>The HTMLServlet class works with the <a href="servparam.htm#servparam"> HTMLParameter</a> class,
which specifies the parameters available to the servlet.</p>
<p>Methods for
the HTMLServlet class include:</p>
<ul><li><a href="javadoc/com/ibm/as400/util/html/HTMLServlet.html#ADDPARAMETER(COM.IBM.AS400.UTIL.HTML.HTMLPARAMETER)">Add</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLServlet.html#REMOVEPARAMETER(COM.IBM.AS400.UTIL.HTML.HTMLPARAMETER)">remove</a> HTMLParameters from the servlet tag</li>
<li><a href="javadoc/com/ibm/as400/util/html/HTMLServlet.html#GETLOCATION()">Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLServlet.html#SETLOCATION(JAVA.LANG.STRING)">set</a> the location of the servlet</li>
<li><a href="javadoc/com/ibm/as400/util/html/HTMLServlet.html#GETNAME()">Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLServlet.html#SETNAME(JAVA.LANG.STRING)">set</a> the name of the servlet</li>
<li><a href="javadoc/com/ibm/as400/util/html/HTMLServlet.html#GETTEXT()">Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLServlet.html#SETTEXT(JAVA.LANG.STRING)">set</a> the alternate text of the servlet</li>
</ul>
</div>
<div class="section" id="htmserv__htmservex"><a name="htmserv__htmservex"><!-- --></a><h4 class="sectiontitle">Example: Creating HTMLServlet tags</h4><p>The
following example an HTMLServlet tag:</p>
<pre> // Create an HTMLServlet.
HTMLServlet servlet = new HTMLServlet("myServlet", "http://server:port/dir");
// Create a parameter, then add it to the servlet.
HTMLParameter param = new HTMLParameter("parm1", "value1");
servlet.addParameter(param);
// Create and add second parameter
HTMLParameter param2 = servlet.add("parm2", "value2");
// Create the alternate text if the Web server does not support the servlet tag.
servlet.setText("The Web server providing this page does not support the SERVLET tag.");
System.out.println(servlet);</pre>
<p>The previous example produces
the following tags:</p>
<pre> &lt;servlet name="myServlet" codebase="http://server:port/dir"&gt;
&lt;param name="parm1" value="value1"&gt;
&lt;param name="parm2" value="value2"&gt;
The Web server providing this page does not support the SERVLET tag.
&lt;/servlet&gt;</pre>
</div>
</div>
</body>
</html>