You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by me...@apache.org on 2009/06/07 14:55:40 UTC

svn commit: r782382 - /incubator/click/trunk/tools/docbook/src/docbook/click/chapter-configuration.xml

Author: medgar
Date: Sun Jun  7 12:55:40 2009
New Revision: 782382

URL: http://svn.apache.org/viewvc?rev=782382&view=rev
Log:
updated doco

Modified:
    incubator/click/trunk/tools/docbook/src/docbook/click/chapter-configuration.xml

Modified: incubator/click/trunk/tools/docbook/src/docbook/click/chapter-configuration.xml
URL: http://svn.apache.org/viewvc/incubator/click/trunk/tools/docbook/src/docbook/click/chapter-configuration.xml?rev=782382&r1=782381&r2=782382&view=diff
==============================================================================
--- incubator/click/trunk/tools/docbook/src/docbook/click/chapter-configuration.xml (original)
+++ incubator/click/trunk/tools/docbook/src/docbook/click/chapter-configuration.xml Sun Jun  7 12:55:40 2009
@@ -133,8 +133,72 @@
       strategy is configured with the Click application mode element in the
       "<filename>click.xml</filename>" config file, covered next.
       </para>
+    </sect2>
+    
+    
+    <sect2 id="type-converter-class" remap="h3">
+      <title>Type Converter Class</title>
+
+      <para>
+      The ClickServlet uses the OGNL library for type coercion when binding
+      request parameters to bindable fields. The default type converter class 
+      use is <ulink url="click-api/org/apache/click/util/RequestTypeConverter.html">RequestTypeConverter</ulink>.
+      To specify your own type converter configure a <literal>type-converter-class</literal>
+      init parameter with the ClickServlet. For example:
+      </para>
+      
+        <programlisting language="xml">
+  &lt;servlet&gt;
+    &lt;servlet-name&gt;ClickServlet&lt;/servlet-name&gt;
+    &lt;servlet-class&gt;org.apache.click.ClickServlet&lt;/servlet-class&gt;
+    &lt;load-on-startup&gt;0&lt;/load-on-startup&gt;
+    &lt;init-param&gt;
+	    &lt;param-name&gt;type-converter-class&lt;/param-name&gt;
+	    &lt;param-value&gt;com.mycorp.util.CustomTypeConverter&lt;/param-value&gt;
+    &lt;/init-param&gt;
+  &lt;/servlet&gt;
+		</programlisting>
+
+    </sect2>    
+    
+    <sect2 id="config-service-class" remap="h3">
+      <title>Config Service Classs</title>
 
+      <para>
+      Click uses a single application configuration service which is
+      instantiated by the ClickServlet at startup. This service defines the 
+      applications configuration and is used the ClickServlet to map request
+      to pages amongst other things.
+      </para>
+ 		
+ 	  <para>
+      Once the ConfigService has been initialized it is stored in the
+      ServletContext using the key  <ulink url="click-api/org/apache/click/service/ConfigService.html">ConfigService</ulink>
+      The default ConfigService is <ulink url="click-api/org/apache/click/service/XmlConfigService.html">XmlConfigService</ulink>.     
+      To us an alternative configuration service specify a <literal>config-service-class</literal> 
+      context parameter. For example:
+ 	  </para>
+      
+        <programlisting language="xml">
+&lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+   version="2.4"&gt;
+
+ ...
+
+     &lt;context-param&gt;
+         &lt;param-name&gt;config-service-class&lt;/param-name&gt;
+          &lt;param-value&gt;com.mycorp.service.CustomConfigSerivce&lt;/param-value&gt;
+      &lt;/context-param&gt;
+ 
+  ...
+ 
+ &lt;/web-app&gt;
+		</programlisting>
+      
     </sect2>
+    
   </sect1>
 
   <sect1 id="application-configuration" remap="h2">