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

75 lines
4.5 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="HTMLMeta 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="htmlmeta" />
<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>HTMLMeta class</title>
</head>
<body id="htmlmeta"><a name="htmlmeta"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">HTMLMeta class</h1>
<div><p></p>
<div class="section"><p>The <a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#NAVBAR_TOP"> HTMLMeta</a> class represents meta-information
used within an HTMLHead tag. Attributes in META tags are used when identifying,
indexing, and defining information within the HTML document.</p>
<p>Attributes
of the META tag include:</p>
<ul><li>NAME - the name associated with the contents of the META tag</li>
<li>CONTENT - values associated with the NAME attribute</li>
<li>HTTP-EQUIV - information gathered by HTTP servers for response message
headers</li>
<li>LANG - the language</li>
<li>URL - used to redirect users from the current page to another URL</li>
</ul>
<p>For example, to help search engines determine the contents of a page,
you might use the following META tag:</p>
<pre> &lt;META name="keywords" lang="en-us" content="games, cards, bridge"&gt;</pre>
<p>You
can also use HTMLMeta to redirect a user from one page to another.</p>
<p>Methods
for the HTMLMeta class include:</p>
<ul><li><a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#GETNAME()">Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#SETNAME(JAVA.LANG.STRING)"> set</a> the NAME attribute</li>
<li><a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#GETCONTENT()"> Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#SETCONTENT(JAVA.LANG.STRING)"> set</a> the CONTENT attribute</li>
<li><a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#GETHTTPEQUIV()"> Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#SETHTTPEQUIV(JAVA.LANG.STRING)"> set</a> the HTTP-EQUIV attribute</li>
<li><a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#GETLANGUAGE()"> Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#SETLANGUAGE(JAVA.LANG.STRING)"> set</a> the LANG attribute</li>
<li><a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#GETURL()">Get</a> and <a href="javadoc/com/ibm/as400/util/html/HTMLMeta.html#SETURL(JAVA.LANG.STRING)"> set</a> the URL attribute</li>
</ul>
</div>
<div class="section" id="htmlmeta__htmlmetaex"><a name="htmlmeta__htmlmetaex"><!-- --></a><h4 class="sectiontitle">Example: Creating META tags</h4><p>The
following example creates two META tags:</p>
<pre> // Create a META tag to help search engines determine page content.
HTMLMeta meta1 = new HTMLMeta();
meta1.setName("keywords");
meta1.setLang("en-us");
meta1.setContent("games, cards, bridge");
// Create a META tag used by caches to determine when to refresh the page.
HTMLMeta meta2 = new HTMLMeta("Expires", "Mon, 01 Jun 2000 12:00:00 GMT");
System.out.print(meta1 + "\r\n" + meta2);</pre>
<p>The previous
example produces the following tags:</p>
<pre> &lt;meta name="keywords" content="games, cards, bridge"&gt;
&lt;meta http-equiv="Expires" content="Mon, 01 Jun 2000 12:00:00 GMT"&gt;</pre>
</div>
</div>
</body>
</html>