author | František Kučera <franta-hg@frantovo.cz> |
Sun, 01 Mar 2009 11:06:49 +0100 | |
changeset 4 | 249560bcc466 |
parent 1 | 639991d0808a |
permissions | -rw-r--r-- |
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(3): Install the Cewolf Servlet in your Web |
franta-hg@1 | 5 |
Application</title> |
franta-hg@1 | 6 |
<meta name="author" content="Guido Laures"> |
franta-hg@1 | 7 |
<link href="../cewolf.css" rel="stylesheet" type="text/css"> |
franta-hg@1 | 8 |
</head> |
franta-hg@1 | 9 |
<body> |
franta-hg@1 | 10 |
<h1>Tutorial: Step 3</h1> |
franta-hg@1 | 11 |
<h2>Install the Cewolf Servlet in your Web App</h2> |
franta-hg@1 | 12 |
<p> The rendering of the entire chart is finally provided via a servlet. |
franta-hg@1 | 13 |
This has to be installed in your web application. Cewolf provides a |
franta-hg@1 | 14 |
servlet class <tt>de.laures.cewolf.CewolfRenderer</tt> which does the |
franta-hg@1 | 15 |
job.<br> |
franta-hg@1 | 16 |
To configure your web application you have to edit the <tt>/WEB-INF/web.xml</tt> |
franta-hg@1 | 17 |
file. Add the following lines to it:<br> |
franta-hg@1 | 18 |
</p> |
franta-hg@1 | 19 |
<pre><servlet><br> <servlet-name>CewolfServlet</servlet-name><br> <servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class><br></servlet><br></pre> |
franta-hg@1 | 20 |
Additionally you should provide a servlet-mapping to tell the container |
franta-hg@1 | 21 |
which URL maps to your Cewolf rendering servlet.<br> |
franta-hg@1 | 22 |
<pre><servlet-mapping><br> <servlet-name>CewolfServlet</servlet-name><br> |
franta-hg@1 | 23 |
<url-pattern>/cewolf/*</url-pattern><br></servlet-mapping><br></pre> |
franta-hg@1 | 24 |
|
franta-hg@1 | 25 |
You also need to tell CeWolf to load on startup: |
franta-hg@1 | 26 |
<pre> <load-on-startup>1</load-on-startup></pre> |
franta-hg@1 | 27 |
To test the correct installation you should start your web app and try |
franta-hg@1 | 28 |
to call the rendering servlet with a browser (e.g. |
franta-hg@1 | 29 |
http://localhost:8080/myapp/cewolf?state). Cewolf should answer: "Cewolf |
franta-hg@1 | 30 |
servlet up and running." |
franta-hg@1 | 31 |
|
franta-hg@1 | 32 |
Here is a copy of the example web.xml: |
franta-hg@1 | 33 |
<pre><web-app> |
franta-hg@1 | 34 |
<servlet> |
franta-hg@1 | 35 |
<servlet-name>CewolfServlet</servlet-name> |
franta-hg@1 | 36 |
<servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class> |
franta-hg@1 | 37 |
<!-- sets storage implementation --> |
franta-hg@1 | 38 |
<init-param> |
franta-hg@1 | 39 |
<param-name>storage</param-name> |
franta-hg@1 | 40 |
<param-value>de.laures.cewolf.storage.TransientSessionStorage</param-value> |
franta-hg@1 | 41 |
</init-param> |
franta-hg@1 | 42 |
<!-- sets overlib.js location relative to webapp --> |
franta-hg@1 | 43 |
<init-param> |
franta-hg@1 | 44 |
<param-name>overliburl</param-name> |
franta-hg@1 | 45 |
<param-value>etc/overlib.js</param-value> |
franta-hg@1 | 46 |
</init-param> |
franta-hg@1 | 47 |
<!-- turn on or off debugging logging --> |
franta-hg@1 | 48 |
<init-param> |
franta-hg@1 | 49 |
<param-name>debug</param-name> |
franta-hg@1 | 50 |
<param-value>true</param-value> |
franta-hg@1 | 51 |
</init-param> |
franta-hg@1 | 52 |
<load-on-startup>1</load-on-startup> |
franta-hg@1 | 53 |
</servlet> |
franta-hg@1 | 54 |
|
franta-hg@1 | 55 |
<servlet-mapping> |
franta-hg@1 | 56 |
<servlet-name>CewolfServlet</servlet-name> |
franta-hg@1 | 57 |
<url-pattern>/cewolf/*</url-pattern> |
franta-hg@1 | 58 |
</servlet-mapping> |
franta-hg@1 | 59 |
|
franta-hg@1 | 60 |
<session-config> |
franta-hg@1 | 61 |
<session-timeout>1</session-timeout> |
franta-hg@1 | 62 |
</session-config> |
franta-hg@1 | 63 |
|
franta-hg@1 | 64 |
<mime-mapping> |
franta-hg@1 | 65 |
<extension>css</extension> |
franta-hg@1 | 66 |
<mime-type>text/css</mime-type> |
franta-hg@1 | 67 |
</mime-mapping> |
franta-hg@1 | 68 |
|
franta-hg@1 | 69 |
<welcome-file-list> |
franta-hg@1 | 70 |
<welcome-file> |
franta-hg@1 | 71 |
index.html |
franta-hg@1 | 72 |
</welcome-file> |
franta-hg@1 | 73 |
<welcome-file> |
franta-hg@1 | 74 |
index.htm |
franta-hg@1 | 75 |
</welcome-file> |
franta-hg@1 | 76 |
</welcome-file-list> |
franta-hg@1 | 77 |
|
franta-hg@1 | 78 |
<!-- resource-ref> |
franta-hg@1 | 79 |
<description> |
franta-hg@1 | 80 |
Resource reference to a factory for java.sql.Connection |
franta-hg@1 | 81 |
instances that may be used for talking to a particular |
franta-hg@1 | 82 |
database that is configured in the server.xml file. |
franta-hg@1 | 83 |
</description> |
franta-hg@1 | 84 |
<resource-ref-name> |
franta-hg@1 | 85 |
jdbc/testdb |
franta-hg@1 | 86 |
</resource-ref-name> |
franta-hg@1 | 87 |
<res-type> |
franta-hg@1 | 88 |
javax.sql.DataSource |
franta-hg@1 | 89 |
</res-type> |
franta-hg@1 | 90 |
<res-auth> |
franta-hg@1 | 91 |
Container |
franta-hg@1 | 92 |
</res-auth> |
franta-hg@1 | 93 |
</resource-ref --> |
franta-hg@1 | 94 |
|
franta-hg@1 | 95 |
</web-app> |
franta-hg@1 | 96 |
</pre> |
franta-hg@1 | 97 |
|
franta-hg@1 | 98 |
<p> <a href="step4.html">Step 4: Define the Chart in your JSP>></a> </p> |
franta-hg@1 | 99 |
<a height="30" target="new" href="http://sourceforge.net"><img |
franta-hg@1 | 100 |
alt="SourceForge Logo" border="0" height="30" |
franta-hg@1 | 101 |
src="http://sourceforge.net/sflogo.php?group_id=57282&type=5"></a> |
franta-hg@1 | 102 |
</body> |
franta-hg@1 | 103 |
</html> |