1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/java/cewolf-1.0/src/site/tutorial/step3.html Sat Feb 28 21:36:28 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><servlet><br> <servlet-name>CewolfServlet</servlet-name><br> <servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class><br></servlet><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><servlet-mapping><br> <servlet-name>CewolfServlet</servlet-name><br>
1.26 + <url-pattern>/cewolf/*</url-pattern><br></servlet-mapping><br></pre>
1.27 +
1.28 + You also need to tell CeWolf to load on startup:
1.29 + <pre> <load-on-startup>1</load-on-startup></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><web-app>
1.37 + <servlet>
1.38 + <servlet-name>CewolfServlet</servlet-name>
1.39 + <servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class>
1.40 + <!-- sets storage implementation -->
1.41 + <init-param>
1.42 + <param-name>storage</param-name>
1.43 + <param-value>de.laures.cewolf.storage.TransientSessionStorage</param-value>
1.44 + </init-param>
1.45 + <!-- sets overlib.js location relative to webapp -->
1.46 + <init-param>
1.47 + <param-name>overliburl</param-name>
1.48 + <param-value>etc/overlib.js</param-value>
1.49 + </init-param>
1.50 + <!-- turn on or off debugging logging -->
1.51 + <init-param>
1.52 + <param-name>debug</param-name>
1.53 + <param-value>true</param-value>
1.54 + </init-param>
1.55 + <load-on-startup>1</load-on-startup>
1.56 + </servlet>
1.57 +
1.58 + <servlet-mapping>
1.59 + <servlet-name>CewolfServlet</servlet-name>
1.60 + <url-pattern>/cewolf/*</url-pattern>
1.61 + </servlet-mapping>
1.62 +
1.63 + <session-config>
1.64 + <session-timeout>1</session-timeout>
1.65 + </session-config>
1.66 +
1.67 + <mime-mapping>
1.68 + <extension>css</extension>
1.69 + <mime-type>text/css</mime-type>
1.70 + </mime-mapping>
1.71 +
1.72 + <welcome-file-list>
1.73 + <welcome-file>
1.74 + index.html
1.75 + </welcome-file>
1.76 + <welcome-file>
1.77 + index.htm
1.78 + </welcome-file>
1.79 + </welcome-file-list>
1.80 +
1.81 + <!-- resource-ref>
1.82 + <description>
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 + </description>
1.87 + <resource-ref-name>
1.88 + jdbc/testdb
1.89 + </resource-ref-name>
1.90 + <res-type>
1.91 + javax.sql.DataSource
1.92 + </res-type>
1.93 + <res-auth>
1.94 + Container
1.95 + </res-auth>
1.96 + </resource-ref -->
1.97 +
1.98 +</web-app>
1.99 +</pre>
1.100 +
1.101 +<p> <a href="step4.html">Step 4: Define the Chart in your JSP>></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&type=5"></a>
1.105 +</body>
1.106 +</html>