franta-hg@1: franta-hg@1: franta-hg@1: franta-hg@1: Cewolf Tutorial(3): Install the Cewolf Servlet in your Web franta-hg@1: Application franta-hg@1: franta-hg@1: franta-hg@1: franta-hg@1: franta-hg@1:

Tutorial: Step 3

franta-hg@1:

Install the Cewolf Servlet in your Web App

franta-hg@1:

The rendering of the entire chart is finally provided via a servlet. franta-hg@1: This has to be installed in your web application. Cewolf provides a franta-hg@1: servlet class de.laures.cewolf.CewolfRenderer which does the franta-hg@1: job.
franta-hg@1: To configure your web application you have to edit the /WEB-INF/web.xml franta-hg@1: file. Add the following lines to it:
franta-hg@1:

franta-hg@1:
<servlet>
<servlet-name>CewolfServlet</servlet-name>
<servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class>
</servlet>
franta-hg@1: Additionally you should provide a servlet-mapping to tell the container franta-hg@1: which URL maps to your Cewolf rendering servlet.
franta-hg@1:
<servlet-mapping>
<servlet-name>CewolfServlet</servlet-name>
franta-hg@1: <url-pattern>/cewolf/*</url-pattern>
</servlet-mapping>
franta-hg@1: franta-hg@1: You also need to tell CeWolf to load on startup: franta-hg@1:
 <load-on-startup>1</load-on-startup>
franta-hg@1: To test the correct installation you should start your web app and try franta-hg@1: to call the rendering servlet with a browser (e.g. franta-hg@1: http://localhost:8080/myapp/cewolf?state). Cewolf should answer: "Cewolf franta-hg@1: servlet up and running." franta-hg@1: franta-hg@1: Here is a copy of the example web.xml: franta-hg@1:
<web-app>
franta-hg@1:   <servlet>
franta-hg@1:     <servlet-name>CewolfServlet</servlet-name>
franta-hg@1:     <servlet-class>de.laures.cewolf.CewolfRenderer</servlet-class>
franta-hg@1: 	<!-- sets storage implementation -->
franta-hg@1:     <init-param>
franta-hg@1:         <param-name>storage</param-name>
franta-hg@1:         <param-value>de.laures.cewolf.storage.TransientSessionStorage</param-value>
franta-hg@1:     </init-param>
franta-hg@1: 	<!-- sets overlib.js location relative to webapp -->
franta-hg@1:     <init-param>
franta-hg@1:         <param-name>overliburl</param-name>
franta-hg@1:         <param-value>etc/overlib.js</param-value>
franta-hg@1:     </init-param>
franta-hg@1: 	<!-- turn on or off debugging logging -->
franta-hg@1:     <init-param>
franta-hg@1:         <param-name>debug</param-name>
franta-hg@1:         <param-value>true</param-value>
franta-hg@1:     </init-param>
franta-hg@1:     <load-on-startup>1</load-on-startup>
franta-hg@1:   </servlet>
franta-hg@1: 
franta-hg@1:   <servlet-mapping>
franta-hg@1:     <servlet-name>CewolfServlet</servlet-name>
franta-hg@1:     <url-pattern>/cewolf/*</url-pattern>
franta-hg@1:   </servlet-mapping>
franta-hg@1: 
franta-hg@1:   <session-config>
franta-hg@1:     <session-timeout>1</session-timeout>
franta-hg@1:   </session-config>
franta-hg@1: 
franta-hg@1:   <mime-mapping>
franta-hg@1:       <extension>css</extension>
franta-hg@1:       <mime-type>text/css</mime-type>
franta-hg@1:   </mime-mapping>
franta-hg@1: 
franta-hg@1:   <welcome-file-list>
franta-hg@1:   	<welcome-file>
franta-hg@1:       index.html
franta-hg@1:     </welcome-file>
franta-hg@1:   	<welcome-file>
franta-hg@1:       index.htm
franta-hg@1:     </welcome-file>
franta-hg@1:   </welcome-file-list>
franta-hg@1:   
franta-hg@1: 	<!-- resource-ref>
franta-hg@1: 	  <description>
franta-hg@1: 	    Resource reference to a factory for java.sql.Connection
franta-hg@1: 	    instances that may be used for talking to a particular
franta-hg@1: 	    database that is configured in the server.xml file.
franta-hg@1: 	  </description>
franta-hg@1: 	  <resource-ref-name>
franta-hg@1: 	    jdbc/testdb
franta-hg@1: 	  </resource-ref-name>
franta-hg@1: 	  <res-type>
franta-hg@1: 	    javax.sql.DataSource
franta-hg@1: 	  </res-type>
franta-hg@1: 	  <res-auth>
franta-hg@1: 	    Container
franta-hg@1: 	  </res-auth>
franta-hg@1: 	</resource-ref -->
franta-hg@1: 
franta-hg@1: </web-app>
franta-hg@1: 
franta-hg@1: franta-hg@1:

Step 4: Define the Chart in your JSP>>

franta-hg@1: SourceForge Logo franta-hg@1: franta-hg@1: