1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4 <title>Cewolf Tutorial(3): Install the Cewolf Servlet in your Web
6 <meta name="author" content="Guido Laures">
7 <link href="../cewolf.css" rel="stylesheet" type="text/css">
10 <h1>Tutorial: Step 3</h1>
11 <h2>Install the Cewolf Servlet in your Web App</h2>
12 <p> The rendering of the entire chart is finally provided via a servlet.
13 This has to be installed in your web application. Cewolf provides a
14 servlet class <tt>de.laures.cewolf.CewolfRenderer</tt> which does the
16 To configure your web application you have to edit the <tt>/WEB-INF/web.xml</tt>
17 file. Add the following lines to it:<br>
19 <pre><servlet><br> <servlet-name>CewolfServlet</servlet-name><br> <servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class><br></servlet><br></pre>
20 Additionally you should provide a servlet-mapping to tell the container
21 which URL maps to your Cewolf rendering servlet.<br>
22 <pre><servlet-mapping><br> <servlet-name>CewolfServlet</servlet-name><br>
23 <url-pattern>/cewolf/*</url-pattern><br></servlet-mapping><br></pre>
25 You also need to tell CeWolf to load on startup:
26 <pre> <load-on-startup>1</load-on-startup></pre>
27 To test the correct installation you should start your web app and try
28 to call the rendering servlet with a browser (e.g.
29 http://localhost:8080/myapp/cewolf?state). Cewolf should answer: "Cewolf
30 servlet up and running."
32 Here is a copy of the example web.xml:
35 <servlet-name>CewolfServlet</servlet-name>
36 <servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class>
37 <!-- sets storage implementation -->
39 <param-name>storage</param-name>
40 <param-value>de.laures.cewolf.storage.TransientSessionStorage</param-value>
42 <!-- sets overlib.js location relative to webapp -->
44 <param-name>overliburl</param-name>
45 <param-value>etc/overlib.js</param-value>
47 <!-- turn on or off debugging logging -->
49 <param-name>debug</param-name>
50 <param-value>true</param-value>
52 <load-on-startup>1</load-on-startup>
55 <servlet-mapping>
56 <servlet-name>CewolfServlet</servlet-name>
57 <url-pattern>/cewolf/*</url-pattern>
58 </servlet-mapping>
60 <session-config>
61 <session-timeout>1</session-timeout>
62 </session-config>
65 <extension>css</extension>
66 <mime-type>text/css</mime-type>
69 <welcome-file-list>
76 </welcome-file-list>
78 <!-- resource-ref>
80 Resource reference to a factory for java.sql.Connection
81 instances that may be used for talking to a particular
82 database that is configured in the server.xml file.
84 <resource-ref-name>
86 </resource-ref-name>
93 </resource-ref -->
98 <p> <a href="step4.html">Step 4: Define the Chart in your JSP>></a> </p>
99 <a height="30" target="new" href="http://sourceforge.net"><img
100 alt="SourceForge Logo" border="0" height="30"
101 src="http://sourceforge.net/sflogo.php?group_id=57282&type=5"></a>