Return-Path: Delivered-To: apmail-incubator-click-commits-archive@minotaur.apache.org Received: (qmail 29979 invoked from network); 26 Jul 2009 14:58:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Jul 2009 14:58:45 -0000 Received: (qmail 15014 invoked by uid 500); 26 Jul 2009 14:59:50 -0000 Delivered-To: apmail-incubator-click-commits-archive@incubator.apache.org Received: (qmail 14999 invoked by uid 500); 26 Jul 2009 14:59:50 -0000 Mailing-List: contact click-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: click-dev@incubator.apache.org Delivered-To: mailing list click-commits@incubator.apache.org Received: (qmail 14989 invoked by uid 99); 26 Jul 2009 14:59:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Jul 2009 14:59:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Jul 2009 14:59:40 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 92A4523888A0; Sun, 26 Jul 2009 14:59:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r797943 - in /incubator/click/trunk/click/documentation: docs/faq.html xdocs/src/docbook/click/chapter-pages.xml Date: Sun, 26 Jul 2009 14:59:19 -0000 To: click-commits@incubator.apache.org From: sabob@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090726145919.92A4523888A0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sabob Date: Sun Jul 26 14:59:19 2009 New Revision: 797943 URL: http://svn.apache.org/viewvc?rev=797943&view=rev Log: added docs describing how to implement custom extensions Modified: incubator/click/trunk/click/documentation/docs/faq.html incubator/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-pages.xml Modified: incubator/click/trunk/click/documentation/docs/faq.html URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/documentation/docs/faq.html?rev=797943&r1=797942&r2=797943&view=diff ============================================================================== --- incubator/click/trunk/click/documentation/docs/faq.html (original) +++ incubator/click/trunk/click/documentation/docs/faq.html Sun Jul 26 14:59:19 2009 @@ -507,10 +507,15 @@ 14.  Can Click be mapped to an extension other than *.htm?
- Currently Click only supports *.htm extension. You cannot create templates - with a different extension for example '.xml'. + By default Click supports *.htm and *.jsp extensions.

- However you can map URLs to different extensions using + However you can map templates with different extensions, for example *.xml, by + subclassing XmlConfigService and specify extra mappings by overriding + isTemplate(String path). You can read more details + here. + +

+ You can also map URLs to different extensions using Url Rewrite Filter. It is even possible to rewrite to REST like URLs:

    @@ -551,7 +556,7 @@ Spring uses a DispatcherServlet to route requests to Controller objects and then passes the ModelAndView results to the rendering layer. -
    +
     public interface Controller {
        public ModelAndView handleRequest(HttpServletRequest request, 
                                          HttpServletResponse response) throws Exception;
    @@ -571,11 +576,13 @@
       
    Click fully supports JSP pages.

    - JSP Pages can be automatically loaded, like Velocity templates, and + JSP Pages can be automatically loaded, like Velocity templates, or can be explicitly defined in the click.xml file. - +

    -<page path="customers-table.jsp" class="com.mycorp.pages.CustomersTable"/> 
    +<pages package="com.mycorp.pages"/> + <page path="customers-table.jsp" class="CustomersTable"/> +</pages>
    The page's model data values are automatically added to the request as attributes so they are available in the JSP. Other Click values added Modified: incubator/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-pages.xml URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-pages.xml?rev=797943&r1=797942&r2=797943&view=diff ============================================================================== --- incubator/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-pages.xml (original) +++ incubator/click/trunk/click/documentation/xdocs/src/docbook/click/chapter-pages.xml Sun Jul 26 14:59:19 2009 @@ -38,14 +38,21 @@ the Freemarker template engine instead of Velocity, the setup is the same. - The template path must have an .htm extension which + The template path should have an .htm extension which is specified in web.xml to route - *.htm requests to the ClickServlet. Please note that - currently Click only accepts .htm requests, and cannot be - mapped to a different extension in web.xml. + *.htm requests to the ClickServlet. - If you use JSP pages for rendering the .jsp extension + Please note if you want Click to process templates with a different + extension e.g. .xml, you need to implement the method + isTemplate(String path) + and specify the extra extensions. The simplest way is to subclass + XmlConfigService and override the default implementation + as described here. + Also remember to map the new extensions in web.xml. + + + If you use JSP pages for rendering, the .jsp extension must be used. For example: