java/cewolf-1.0/src/site/tutorial/step4.html
author František Kučera <franta-hg@frantovo.cz>
Sat, 28 Feb 2009 21:31:02 +0100
changeset 1 639991d0808a
permissions -rw-r--r--
Rozbalená knihovna verze 1.0
franta-hg@1
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
franta-hg@1
     2
<html>
franta-hg@1
     3
<head>
franta-hg@1
     4
  <title>Cewolf Tutorial(4): Define the chart in your JSP</title>
franta-hg@1
     5
  <meta name="author" content="Guido Laures">
franta-hg@1
     6
  <link href="../cewolf.css" rel="stylesheet" type="text/css">
franta-hg@1
     7
</head>
franta-hg@1
     8
<body>
franta-hg@1
     9
<h1>Tutorial: Step 4</h1>
franta-hg@1
    10
<h2>Define the chart in your JSP</h2>
franta-hg@1
    11
<pre>&lt;%@page contentType="text/html"%&gt;<br>&lt;%@taglib uri='/WEB-INF/cewolf.tld' prefix='cewolf' %&gt;<br>&lt;HTML&gt;<br>&lt;BODY&gt;<br>&lt;H1&gt;Page View Statistics&lt;/H1&gt;<br>&lt;HR&gt;<br>&lt;jsp:useBean id="pageViews" class="de.laures.cewolf.example.PageViewCountData"/&gt;<br>&lt;cewolf:chart <br>    id="line" <br>    title="Page View Statistics" <br>    type="line" <br>    xaxislabel="Page" <br>    yaxislabel="Views"&gt;<br>    &lt;cewolf:data&gt;<br>        &lt;cewolf:producer id="pageViews"/&gt;<br>    &lt;/cewolf:data&gt;<br>&lt;/cewolf:chart&gt;<br>&lt;p&gt;<br>&lt;cewolf:img chartid="line" renderer="cewolf" width="400" height="300"/&gt;<br>&lt;P&gt;<br>&lt;/BODY&gt;<br>&lt;/HTML&gt;<br></pre>
franta-hg@1
    12
<p> As you can see there are different tags of the cewolf taglib
franta-hg@1
    13
involved. The first &lt;cewolf:chart&gt; tag defines a chart with all
franta-hg@1
    14
its parameters. The concrete rendering is handled by the
franta-hg@1
    15
&lt;cewolf:img&gt; tag which adds the correct &lt;img&gt; tag in the
franta-hg@1
    16
rendered HTML page. The connection between both cewolf tags inside the
franta-hg@1
    17
JSP is specified by using the same <tt>id</tt> attributes. </p>
franta-hg@1
    18
<p> When calling this JSP from a client browser you should see the page
franta-hg@1
    19
view statistic chart. If you got a broken image have a look at your
franta-hg@1
    20
container's log files. </p>
franta-hg@1
    21
<p> <a href="step5.html">Step 5: Create ImageMap and Tooltip
franta-hg@1
    22
Information&gt;&gt;</a> </p>
franta-hg@1
    23
<a height="30" target="new" href="http://sourceforge.net"><img
franta-hg@1
    24
 alt="SourceForge Logo" border="0" height="30"
franta-hg@1
    25
 src="http://sourceforge.net/sflogo.php?group_id=57282&amp;type=5"></a>
franta-hg@1
    26
</body>
franta-hg@1
    27
</html>