java/cewolf-1.0/src/site/tutorial/step3.html
changeset 3 a74502ffcffa
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/cewolf-1.0/src/site/tutorial/step3.html	Sun Mar 01 01:27:29 2009 +0100
     1.3 @@ -0,0 +1,103 @@
     1.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title>Cewolf Tutorial(3): Install the Cewolf Servlet in your Web
     1.8 +Application</title>
     1.9 +  <meta name="author" content="Guido Laures">
    1.10 +  <link href="../cewolf.css" rel="stylesheet" type="text/css">
    1.11 +</head>
    1.12 +<body>
    1.13 +<h1>Tutorial: Step 3</h1>
    1.14 +<h2>Install the Cewolf Servlet in your Web App</h2>
    1.15 +<p> The rendering of the entire chart is finally provided via a servlet.
    1.16 +This has to be installed in your web application. Cewolf provides a
    1.17 +servlet class <tt>de.laures.cewolf.CewolfRenderer</tt> which does the
    1.18 +job.<br>
    1.19 +To configure your web application you have to edit the <tt>/WEB-INF/web.xml</tt>
    1.20 +file. Add the following lines to it:<br>
    1.21 +</p>
    1.22 +<pre>&lt;servlet&gt;<br>    &lt;servlet-name&gt;CewolfServlet&lt;/servlet-name&gt;<br>    &lt;servlet-class&gt;de.laures.cewolf.CewolfRenderer&lt;/servlet-class&gt;<br>&lt;/servlet&gt;<br></pre>
    1.23 +Additionally you should provide a servlet-mapping to tell the container
    1.24 +which URL maps to your Cewolf rendering servlet.<br>
    1.25 +<pre>&lt;servlet-mapping&gt;<br>    &lt;servlet-name&gt;CewolfServlet&lt;/servlet-name&gt;<br>  
    1.26 +  &lt;url-pattern&gt;/cewolf/*&lt;/url-pattern&gt;<br>&lt;/servlet-mapping&gt;<br></pre>
    1.27 +  
    1.28 +  You also need to tell CeWolf to load on startup:
    1.29 +  <pre> &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;</pre>
    1.30 +To test the correct installation you should start your web app and try
    1.31 +to call the rendering servlet with a browser (e.g.
    1.32 +http://localhost:8080/myapp/cewolf?state). Cewolf should answer: "Cewolf
    1.33 +servlet up and running."
    1.34 +
    1.35 +Here is a copy of the example web.xml:
    1.36 +<pre>&lt;web-app&gt;
    1.37 +  &lt;servlet&gt;
    1.38 +    &lt;servlet-name&gt;CewolfServlet&lt;/servlet-name&gt;
    1.39 +    &lt;servlet-class&gt;de.laures.cewolf.CewolfRenderer&lt;/servlet-class&gt;
    1.40 +	&lt;!-- sets storage implementation --&gt;
    1.41 +    &lt;init-param&gt;
    1.42 +        &lt;param-name&gt;storage&lt;/param-name&gt;
    1.43 +        &lt;param-value&gt;de.laures.cewolf.storage.TransientSessionStorage&lt;/param-value&gt;
    1.44 +    &lt;/init-param&gt;
    1.45 +	&lt;!-- sets overlib.js location relative to webapp --&gt;
    1.46 +    &lt;init-param&gt;
    1.47 +        &lt;param-name&gt;overliburl&lt;/param-name&gt;
    1.48 +        &lt;param-value&gt;etc/overlib.js&lt;/param-value&gt;
    1.49 +    &lt;/init-param&gt;
    1.50 +	&lt;!-- turn on or off debugging logging --&gt;
    1.51 +    &lt;init-param&gt;
    1.52 +        &lt;param-name&gt;debug&lt;/param-name&gt;
    1.53 +        &lt;param-value&gt;true&lt;/param-value&gt;
    1.54 +    &lt;/init-param&gt;
    1.55 +    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    1.56 +  &lt;/servlet&gt;
    1.57 +
    1.58 +  &lt;servlet-mapping&gt;
    1.59 +    &lt;servlet-name&gt;CewolfServlet&lt;/servlet-name&gt;
    1.60 +    &lt;url-pattern&gt;/cewolf/*&lt;/url-pattern&gt;
    1.61 +  &lt;/servlet-mapping&gt;
    1.62 +
    1.63 +  &lt;session-config&gt;
    1.64 +    &lt;session-timeout&gt;1&lt;/session-timeout&gt;
    1.65 +  &lt;/session-config&gt;
    1.66 +
    1.67 +  &lt;mime-mapping&gt;
    1.68 +      &lt;extension&gt;css&lt;/extension&gt;
    1.69 +      &lt;mime-type&gt;text/css&lt;/mime-type&gt;
    1.70 +  &lt;/mime-mapping&gt;
    1.71 +
    1.72 +  &lt;welcome-file-list&gt;
    1.73 +  	&lt;welcome-file&gt;
    1.74 +      index.html
    1.75 +    &lt;/welcome-file&gt;
    1.76 +  	&lt;welcome-file&gt;
    1.77 +      index.htm
    1.78 +    &lt;/welcome-file&gt;
    1.79 +  &lt;/welcome-file-list&gt;
    1.80 +  
    1.81 +	&lt;!-- resource-ref&gt;
    1.82 +	  &lt;description&gt;
    1.83 +	    Resource reference to a factory for java.sql.Connection
    1.84 +	    instances that may be used for talking to a particular
    1.85 +	    database that is configured in the server.xml file.
    1.86 +	  &lt;/description&gt;
    1.87 +	  &lt;resource-ref-name&gt;
    1.88 +	    jdbc/testdb
    1.89 +	  &lt;/resource-ref-name&gt;
    1.90 +	  &lt;res-type&gt;
    1.91 +	    javax.sql.DataSource
    1.92 +	  &lt;/res-type&gt;
    1.93 +	  &lt;res-auth&gt;
    1.94 +	    Container
    1.95 +	  &lt;/res-auth&gt;
    1.96 +	&lt;/resource-ref --&gt;
    1.97 +
    1.98 +&lt;/web-app&gt;
    1.99 +</pre>
   1.100 +
   1.101 +<p> <a href="step4.html">Step 4: Define the Chart in your JSP&gt;&gt;</a> </p>
   1.102 +<a height="30" target="new" href="http://sourceforge.net"><img
   1.103 + alt="SourceForge Logo" border="0" height="30"
   1.104 + src="http://sourceforge.net/sflogo.php?group_id=57282&amp;type=5"></a>
   1.105 +</body>
   1.106 +</html>