From charles17@example.com Tue Mar 01 10:38:35 2011 Return-Path: <charles17@example.com> Delivered-To: charles17@example.com Received: (qmail 13445 invoked from network); 1 Mar 2011 10:38:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Mar 2011 10:38:35 -0000 Received: (qmail 69001 invoked by uid 500); 1 Mar 2011 10:38:35 -0000 Delivered-To: charles17@example.com Received: (qmail 68861 invoked by uid 500); 1 Mar 2011 10:38:33 -0000 Mailing-List: contact charles17@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:charles17@example.com> List-Unsubscribe: <mailto:charles17@example.com> List-Post: <mailto:charles17@example.com> List-Id: <user.click.apache.org> Reply-To: charles17@example.com Delivered-To: mailing list charles17@example.com Received: (qmail 68853 invoked by uid 99); 1 Mar 2011 10:38:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2011 10:38:32 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of charles17@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-px0-f170.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2011 10:38:24 +0000 Received: by pxi19 with SMTP id 19so849377pxi.29 for <charles17@example.com>; Tue, 01 Mar 2011 02:38:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=NxDBLarBopMhTs6PwPtbj9uxvpKTO069loBkW7+yDwY=; b=Hqf98339TKqfLa2ORTv2LVwsa4DAO0/wAB7c3swt6EbvVDehxQeWMQc9piBmbO1Rts aH17D2uMEpazjxuPdzAuQw5HbdE2PcRpehzpz4scaAZ6npbaQs/bb1RR+p5ohF4765SB XuGvsM4aLOhjhTDUuR/x4ROGrjOldOd6ryFS0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=jUWPM6zV5A/WaOPF7iSacI5xxEg8pBGEg4CBRwKkTktGGB/Fnk+2tLOebTUqm1eU58 xJHPDYLUKjS3pbIcFJZ1gSMHxB3vazZKHCXBeOJmw/iA2qOcdtsaeND5i9jV4ElUnitM BTlYSgHfs4wQMA2UuRGp7Ud8kuxA5bNI7V/po= Received: by 83.161.120.155 with SMTP id b4mr5339580wfg.298.1298975883084; Tue, 01 Mar 2011 02:38:03 -0800 (PST) Received: from [83.161.120.155] ([83.161.120.155]) by mx.google.com with ESMTPS id w19sm7301467wfd.20.283.161.120.155.37.59 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Mar 2011 02:38:01 -0800 (PST) Message-ID: <charles17@example.com> Date: Tue, 01 Mar 2011 12:37:54 +0200 From: Bob Schellink <charles17@example.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:83.161.120.155) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: charles17@example.com Subject: Re: How to redirect to the desired page after successful login? References: <charles17@example.com> <charles17@example.com> <charles17@example.com> In-Reply-To: <charles17@example.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, Click is built on top of Java Servlet API so that doco assumes familiarity with Servlet security. If you are not familiar with Java Servlet Security you will find many books or articles describing the standard. Also note that the standard is quite loose on the implementation and each container is free to provide it's own implementation. So if you use Tomcat you should see the Tomcat doco, same for JBoss etc. Many people opt to use an alternative security to the standard such as Spring Security or Apache Shiro. Hope this helps. Bob On 2011/03/01 00:06 AM, Haim Schindler wrote: > Hi, > > I have read: > > http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#security > > but beside the definitions in web.xml file, I could not figure out how the logic of authentication > works. > where is the logic that works against the database ? > where and how are the users & passwords are stored ? > who is handling the POST request from the login form ? > > Haim > > > On Sun, Feb 20, 2011 at 11:37 PM, Bob Schellink <charles17@example.com <mailto:charles17@example.com>> wrote: > > Hi, > > The scenario you describe is pretty much how Servlet security works[1]. You can also use these > alternatives[2]. > > Bob > > [1]: http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#security > [2]: > http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#alternatve-security-solutions > > On 2011/02/20 17:17 PM, Haim Schindler wrote: > > Hello, > > > > What is the right way in click to redirect to a desired page after successful login? > > > > *here is the scenario:* > > > > user type in the browser url: > > > > *www.site.com/page1000.htm <http://www.site.com/page1000.htm> <http://www.site.com/page1000.htm>* > > > > but user is NOT login so he was redirected to > > > > *www.site.com/login.htm <http://www.site.com/login.htm> <http://www.site.com/login.htm>* > > > > after successful login I want the user to be automatically redirected to > > > > *www.site.com/page1000.htm <http://www.site.com/page1000.htm> > <http://www.site.com/page1000.htm> * (the original url that the user wanted) > > > > (now what I do is a bit tedios, I keep this information the the url to login.htm?.... and then > I use > > hidden fields in the login form so that info goes to login process after post....) > > > > From charles17@example.com Wed Mar 02 21:40:35 2011 Return-Path: <charles17@example.com> Delivered-To: charles17@example.com Received: (qmail 14777 invoked from network); 2 Mar 2011 21:40:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Mar 2011 21:40:35 -0000 Received: (qmail 43119 invoked by uid 500); 2 Mar 2011 21:40:35 -0000 Delivered-To: charles17@example.com Received: (qmail 43086 invoked by uid 500); 2 Mar 2011 21:40:34 -0000 Mailing-List: contact charles17@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:charles17@example.com> List-Unsubscribe: <mailto:charles17@example.com> List-Post: <mailto:charles17@example.com> List-Id: <user.click.apache.org> Reply-To: charles17@example.com Delivered-To: mailing list charles17@example.com Received: (qmail 43077 invoked by uid 99); 2 Mar 2011 21:40:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Mar 2011 21:40:34 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO composersnotebook.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Mar 2011 21:40:26 +0000 Received: from mail-vx0-f170.google.com ([83.161.120.155]) by cp46.myhostcenter.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.69) (envelope-from <charles17@example.com>) id 1Putm9-0007Pb-Or for charles17@example.com; Wed, 02 Mar 2011 16:40:05 -0500 Received: by vxb39 with SMTP id 39so406602vxb.29 for <charles17@example.com>; Wed, 02 Mar 2011 13:40:02 -0800 (PST) MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id cg8mr533392vdc.182.1299102002789; Wed, 02 Mar 2011 13:40:02 -0800 (PST) Received: by 83.161.120.155 with HTTP; Wed, 2 Mar 2011 13:40:02 -0800 (PST) Date: Wed, 2 Mar 2011 16:40:02 -0500 Message-ID: <charles17@example.com> Subject: example of Panel with jsp From: Ari <charles17@example.com> To: charles17@example.com Content-Type: multipart/alternative; boundary=bcaec501c43a673bc2049d86c1da X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cp46.myhostcenter.com X-AntiAbuse: Original Domain - click.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - composersnotebook.com --bcaec501c43a673bc2049d86c1da Content-Type: text/plain; charset=ISO-8859-1 Hi, I wondered if someone might have a working example of a Panel being used with a JSP as its view template. JSPs work ok for me with regular Click Pages, but when I try to use a Panel, I get errors of this nature: [Click] [error] Velocity: Parser Exception: /mypath/mypanel-template.jsporg.apache.velocity.runtime.parser.ParseException: Encountered ":length(userLinks)}\n<div> userLinks is an Array<PageLink> which I've defined in my Panel.java subclass, and am referencing in the JSP as shown in the error, so it is reaching the JSP. But it seems like Click is trying to interpret the template as Velocity instead of JSP, even though I've overridden the Page's getTemplate() method to return a jsp file name (as demonstrated by the fact that it reaches the jsp!). Any advice or examples would be much appreciated. Thanks, Ari --bcaec501c43a673bc2049d86c1da Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,<br><br>I wondered if someone might have a working example of a Panel be= ing used with a JSP as its view template.=A0 JSPs work ok for me with regul= ar Click Pages, but when I try to use a Panel, I get errors of this nature:= <br> <br>[Click] [error] Velocity: Parser Exception: /mypath/mypanel-template.js= porg.apache.velocity.runtime.parser.ParseException: Encountered &quot;:leng= th(userLinks)}\n&lt;div&gt;<br><br>userLinks is an Array&lt;PageLink&gt; wh= ich I&#39;ve defined in my Panel.java subclass, and am referencing in the J= SP as shown in the error, so it is reaching the JSP.=A0 But it seems like C= lick is trying to interpret the template as Velocity instead of JSP, even t= hough I&#39;ve overridden the Page&#39;s getTemplate() method to return a j= sp file name (as demonstrated by the fact that it reaches the jsp!).<br> <br>Any advice or examples would be much appreciated.<br><br>Thanks,<br>Ari= <br> --bcaec501c43a673bc2049d86c1da-- From charles17@example.com Thu Mar 03 02:15:12 2011 Return-Path: <charles17@example.com> Delivered-To: charles17@example.com Received: (qmail 17452 invoked from network); 3 Mar 2011 02:15:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Mar 2011 02:15:12 -0000 Received: (qmail 57646 invoked by uid 500); 3 Mar 2011 02:15:11 -0000 Delivered-To: charles17@example.com Received: (qmail 57626 invoked by uid 500); 3 Mar 2011 02:15:11 -0000 Mailing-List: contact charles17@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:charles17@example.com> List-Unsubscribe: <mailto:charles17@example.com> List-Post: <mailto:charles17@example.com> List-Id: <user.click.apache.org> Reply-To: charles17@example.com Delivered-To: mailing list charles17@example.com Received: (qmail 57618 invoked by uid 99); 3 Mar 2011 02:15:10 -0000 Received: from Unknown (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 02:15:10 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO composersnotebook.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 02:14:49 +0000 Received: from mail-vx0-f170.google.com ([83.161.120.155]) by cp46.myhostcenter.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.69) (envelope-from <charles17@example.com>) id 1Puy3g-0003iM-2m for charles17@example.com; Wed, 02 Mar 2011 21:14:28 -0500 Received: by vxb39 with SMTP id 39so607559vxb.29 for <charles17@example.com>; Wed, 02 Mar 2011 18:14:25 -0800 (PST) MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id w20mr172048vcj.34.1299118465123; Wed, 02 Mar 2011 18:14:25 -0800 (PST) Received: by 83.161.120.155 with HTTP; Wed, 2 Mar 2011 18:14:25 -0800 (PST) In-Reply-To: <charles17@example.com> References: <charles17@example.com> Date: Wed, 2 Mar 2011 21:14:25 -0500 Message-ID: <charles17@example.com> Subject: Re: example of Panel with jsp From: Ari <charles17@example.com> To: charles17@example.com Content-Type: multipart/alternative; boundary=0016e65c8a4aa28783049d8a968d X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cp46.myhostcenter.com X-AntiAbuse: Original Domain - click.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - composersnotebook.com X-Virus-Checked: Checked by ClamAV on apache.org --0016e65c8a4aa28783049d8a968d Content-Type: text/plain; charset=ISO-8859-1 Minor corrections to my own question... 1) userLinks is a List<PageLink>, not an array. 2) I've overridden the Panel's getTemplate(), not the Page's. The page merely includes the Panel like any other component. Thanks again for any suggestions as to what might be wrong. Ari On Wed, Mar 2, 2011 at 4:40 PM, Ari <charles17@example.com> wrote: > Hi, > > I wondered if someone might have a working example of a Panel being used > with a JSP as its view template. JSPs work ok for me with regular Click > Pages, but when I try to use a Panel, I get errors of this nature: > > [Click] [error] Velocity: Parser Exception: > /mypath/mypanel-template.jsporg.apache.velocity.runtime.parser.ParseException: > Encountered ":length(userLinks)}\n<div> > > userLinks is an Array<PageLink> which I've defined in my Panel.java > subclass, and am referencing in the JSP as shown in the error, so it is > reaching the JSP. But it seems like Click is trying to interpret the > template as Velocity instead of JSP, even though I've overridden the Page's > getTemplate() method to return a jsp file name (as demonstrated by the fact > that it reaches the jsp!). > > Any advice or examples would be much appreciated. > > Thanks, > Ari > --0016e65c8a4aa28783049d8a968d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Minor corrections to my own question...<br><br>1) userLinks is a List&lt;Pa= geLink&gt;, not an array.<br><br>2) I&#39;ve overridden the Panel&#39;s get= Template(), not the Page&#39;s.=A0 The page merely includes the Panel like = any other component.<br> <br>Thanks again for any suggestions as to what might be wrong.<br><br>Ari<= br><br><div class=3D"gmail_quote">On Wed, Mar 2, 2011 at 4:40 PM, Ari <span= dir=3D"ltr">&lt;<a href=3D"mailto:charles17@example.com">ari@composers= notebook.com</a>&gt;</span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde= r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br><br>I wond= ered if someone might have a working example of a Panel being used with a J= SP as its view template.=A0 JSPs work ok for me with regular Click Pages, b= ut when I try to use a Panel, I get errors of this nature:<br> <br>[Click] [error] Velocity: Parser Exception: /mypath/mypanel-template.js= porg.apache.velocity.runtime.parser.ParseException: Encountered &quot;:leng= th(userLinks)}\n&lt;div&gt;<br><br>userLinks is an Array&lt;PageLink&gt; wh= ich I&#39;ve defined in my Panel.java subclass, and am referencing in the J= SP as shown in the error, so it is reaching the JSP.=A0 But it seems like C= lick is trying to interpret the template as Velocity instead of JSP, even t= hough I&#39;ve overridden the Page&#39;s getTemplate() method to return a j= sp file name (as demonstrated by the fact that it reaches the jsp!).<br> <br>Any advice or examples would be much appreciated.<br><br>Thanks,<br><fo= nt color=3D"#888888">Ari<br> </font></blockquote></div><br> --0016e65c8a4aa28783049d8a968d-- From charles17@example.com Thu Mar 03 07:08:04 2011 Return-Path: <charles17@example.com> Delivered-To: charles17@example.com Received: (qmail 88177 invoked from network); 3 Mar 2011 07:08:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Mar 2011 07:08:04 -0000 Received: (qmail 79679 invoked by uid 500); 3 Mar 2011 07:08:02 -0000 Delivered-To: charles17@example.com Received: (qmail 79627 invoked by uid 500); 3 Mar 2011 07:08:01 -0000 Mailing-List: contact charles17@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:charles17@example.com> List-Unsubscribe: <mailto:charles17@example.com> List-Post: <mailto:charles17@example.com> List-Id: <user.click.apache.org> Reply-To: charles17@example.com Delivered-To: mailing list charles17@example.com Received: (qmail 79617 invoked by uid 99); 3 Mar 2011 07:08:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 07:08:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of charles17@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-iw0-f170.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 07:07:55 +0000 Received: by iwn3 with SMTP id 3so739515iwn.29 for <charles17@example.com>; Wed, 02 Mar 2011 23:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=LNIHYCaLFGdSoeMF/JiHsVIkW0SMXEY6rrhk0iop1Nk=; b=TjjHj9V8ier5r7cI/F0nNKKVZahG9l1KYBwpSIDqp3ziCts5WzKDLm0dixCCZ40aKZ 7FVgHtRpbZAHTyL98803eOKcK34mfQ24YOYmJgdA/F4ZzYJjGiSst5u3erzqBsl01oWp AveF812XvPJ9RTNxMZE49qw9TRarckLBzPyVo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=tfXBZigGOxg2osb+Eri+pDfpYTgR2OQfkd2kJMsfPWVJxmZEXA4CLBo9AdFuLeXH3Z Yruxop5TkftnBTwGw3oSXCjL7wD5zGlrYlZNyCivWePyratzQsjoHwO4aI+VcushVQJA TfK9UxZi19laE+H3exZ0hbPpIZ9m+ndBYq86Y= Received: by 83.161.120.155 with SMTP id hx1mr1061017icb.525.1299136053920; Wed, 02 Mar 2011 23:07:33 -0800 (PST) Received: from [83.161.120.155] ([83.161.120.155]) by mx.google.com with ESMTPS id uf10sm529159icb.17.283.161.120.155.07.30 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Mar 2011 23:07:33 -0800 (PST) Message-ID: <charles17@example.com> Date: Thu, 03 Mar 2011 09:07:24 +0200 From: Bob Schellink <charles17@example.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:83.161.120.155) Gecko/20110221 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: charles17@example.com Subject: Re: example of Panel with jsp References: <charles17@example.com> <charles17@example.com> In-Reply-To: <charles17@example.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm not sure if that is possible actually. The question is how would you render the JSP template to a String which the Panel can return. If you know of a way you can create a custom Panel to achieve that. One route might be to create a custom HttpServletResponse using a ByteArray which you then forward to the container's JSP engine. Once it returns the byteArray should contain the content. Bob On 2011/03/03 04:14 AM, Ari wrote: > Minor corrections to my own question... > > 1) userLinks is a List<PageLink>, not an array. > > 2) I've overridden the Panel's getTemplate(), not the Page's. The page merely includes the Panel > like any other component. > > Thanks again for any suggestions as to what might be wrong. > > Ari > > On Wed, Mar 2, 2011 at 4:40 PM, Ari <charles17@example.com <mailto:charles17@example.com>> > wrote: > > Hi, > > I wondered if someone might have a working example of a Panel being used with a JSP as its view > template. JSPs work ok for me with regular Click Pages, but when I try to use a Panel, I get > errors of this nature: > > [Click] [error] Velocity: Parser Exception: > /mypath/mypanel-template.jsporg.apache.velocity.runtime.parser.ParseException: Encountered > ":length(userLinks)}\n<div> > > userLinks is an Array<PageLink> which I've defined in my Panel.java subclass, and am referencing > in the JSP as shown in the error, so it is reaching the JSP. But it seems like Click is trying > to interpret the template as Velocity instead of JSP, even though I've overridden the Page's > getTemplate() method to return a jsp file name (as demonstrated by the fact that it reaches the > jsp!). > > Any advice or examples would be much appreciated. > > Thanks, > Ari > > From charles17@example.com Thu Mar 03 18:29:07 2011 Return-Path: <charles17@example.com> Delivered-To: charles17@example.com Received: (qmail 2748 invoked from network); 3 Mar 2011 18:29:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Mar 2011 18:29:07 -0000 Received: (qmail 91144 invoked by uid 500); 3 Mar 2011 18:29:07 -0000 Delivered-To: charles17@example.com Received: (qmail 91123 invoked by uid 500); 3 Mar 2011 18:29:07 -0000 Mailing-List: contact charles17@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:charles17@example.com> List-Unsubscribe: <mailto:charles17@example.com> List-Post: <mailto:charles17@example.com> List-Id: <user.click.apache.org> Reply-To: charles17@example.com Delivered-To: mailing list charles17@example.com Received: (qmail 91115 invoked by uid 99); 3 Mar 2011 18:29:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 18:29:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO composersnotebook.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Mar 2011 18:29:01 +0000 Received: from mail-vw0-f42.google.com ([83.161.120.155]) by cp46.myhostcenter.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.69) (envelope-from <charles17@example.com>) id 1PvDGR-0001ZH-Jh for charles17@example.com; Thu, 03 Mar 2011 13:28:39 -0500 Received: by vws10 with SMTP id 10so1230602vws.29 for <charles17@example.com>; Thu, 03 Mar 2011 10:28:36 -0800 (PST) MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id w18mr2234398vdu.177.1299176916400; Thu, 03 Mar 2011 10:28:36 -0800 (PST) Received: by 83.161.120.155 with HTTP; Thu, 3 Mar 2011 10:28:36 -0800 (PST) In-Reply-To: <charles17@example.com> References: <charles17@example.com> <charles17@example.com> <charles17@example.com> Date: Thu, 3 Mar 2011 13:28:36 -0500 Message-ID: <charles17@example.com> Subject: Re: example of Panel with jsp From: Ari <charles17@example.com> To: charles17@example.com Content-Type: multipart/alternative; boundary=20cf3071cd789a3c2c049d983206 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cp46.myhostcenter.com X-AntiAbuse: Original Domain - click.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - composersnotebook.com --20cf3071cd789a3c2c049d983206 Content-Type: text/plain; charset=ISO-8859-1 Hi, In that case, what do you think about changing the TemplateService.renderTemplate() signature to allow the Context to be passed in? Velocity and Freemarker TemplateServices would just ignore it and function exactly as before (they could trivially implement the new signature by just calling the old one with a null), but a new JspTemplateService could now use this Context to get the HttpServletRequest and Response, which would allow it to render the Jsp normally via RequestDispatcher.include() If writing to an intermediate String is preferred instead of writing directly to output stream then a mock HttpServletResponse can be passed in. This mock instance would implement the HttpServletResponse methods but would internally write to a StringWriter instead of the OutputStream. HttpServletResponseWrapper would make a handy starting point for writing such a class. Thoughts? Should I repost in the dev forum? Thanks Ari On Thu, Mar 3, 2011 at 2:07 AM, Bob Schellink <charles17@example.com> wrote: > Hi, > > I'm not sure if that is possible actually. The question is how would you > render the JSP template to > a String which the Panel can return. If you know of a way you can create a > custom Panel to achieve > that. One route might be to create a custom HttpServletResponse using a > ByteArray which you then > forward to the container's JSP engine. Once it returns the byteArray should > contain the content. > > Bob > > > On 2011/03/03 04:14 AM, Ari wrote: > > Minor corrections to my own question... > > > > 1) userLinks is a List<PageLink>, not an array. > > > > 2) I've overridden the Panel's getTemplate(), not the Page's. The page > merely includes the Panel > > like any other component. > > > > Thanks again for any suggestions as to what might be wrong. > > > > Ari > > > > On Wed, Mar 2, 2011 at 4:40 PM, Ari <charles17@example.com <mailto: > charles17@example.com>> > > wrote: > > > > Hi, > > > > I wondered if someone might have a working example of a Panel being > used with a JSP as its view > > template. JSPs work ok for me with regular Click Pages, but when I > try to use a Panel, I get > > errors of this nature: > > > > [Click] [error] Velocity: Parser Exception: > > > /mypath/mypanel-template.jsporg.apache.velocity.runtime.parser.ParseException: > Encountered > > ":length(userLinks)}\n<div> > > > > userLinks is an Array<PageLink> which I've defined in my Panel.java > subclass, and am referencing > > in the JSP as shown in the error, so it is reaching the JSP. But it > seems like Click is trying > > to interpret the template as Velocity instead of JSP, even though > I've overridden the Page's > > getTemplate() method to return a jsp file name (as demonstrated by > the fact that it reaches the > > jsp!). > > > > Any advice or examples would be much appreciated. > > > > Thanks, > > Ari > > > > > > --20cf3071cd789a3c2c049d983206 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,<br><br>In that case, what do you think about changing the TemplateServi= ce.renderTemplate() signature to allow the Context to be passed in?=A0 <br>= <br>Velocity and Freemarker TemplateServices would just ignore it and funct= ion exactly as before (they could trivially implement the new signature by = just calling the old one with a null), but a new JspTemplateService could n= ow use this Context to get the HttpServletRequest and Response, which would= allow it to render the Jsp normally via RequestDispatcher.include()<br> <br>If writing to an intermediate String is preferred instead of writing di= rectly to output stream then a mock HttpServletResponse can be passed in.= =A0 This mock instance would implement the HttpServletResponse methods but = would internally write to a StringWriter instead of the OutputStream.=A0 Ht= tpServletResponseWrapper would make a handy starting point for writing such= a class.<br> <br>Thoughts?=A0 Should I repost in the dev forum?<br><br>Thanks<br>Ari<br>= <br><br><div class=3D"gmail_quote">On Thu, Mar 3, 2011 at 2:07 AM, Bob Sche= llink <span dir=3D"ltr">&lt;<a href=3D"mailto:charles17@example.com">sabob1@gmai= l.com</a>&gt;</span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde= r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br> <br> I&#39;m not sure if that is possible actually. The question is how would yo= u render the JSP template to<br> a String which the Panel can return. If you know of a way you can create a = custom Panel to achieve<br> that. One route might be to create a custom HttpServletResponse using a Byt= eArray which you then<br> forward to the container&#39;s JSP engine. Once it returns the byteArray sh= ould contain the content.<br> <br> Bob<br> <div class=3D"im"><br> <br> On 2011/03/03 04:14 AM, Ari wrote:<br> &gt; Minor corrections to my own question...<br> &gt;<br> &gt; 1) userLinks is a List&lt;PageLink&gt;, not an array.<br> &gt;<br> &gt; 2) I&#39;ve overridden the Panel&#39;s getTemplate(), not the Page&#39= ;s. =A0The page merely includes the Panel<br> &gt; like any other component.<br> &gt;<br> &gt; Thanks again for any suggestions as to what might be wrong.<br> &gt;<br> &gt; Ari<br> &gt;<br> </div>&gt; On Wed, Mar 2, 2011 at 4:40 PM, Ari &lt;<a href=3D"mailto:ari@co= mposersnotebook.com">charles17@example.com</a> &lt;mailto:<a href=3D"ma= ilto:charles17@example.com">charles17@example.com</a>&gt;&gt;<br> <div><div></div><div class=3D"h5">&gt; wrote:<br> &gt;<br> &gt; =A0 =A0 Hi,<br> &gt;<br> &gt; =A0 =A0 I wondered if someone might have a working example of a Panel = being used with a JSP as its view<br> &gt; =A0 =A0 template. =A0JSPs work ok for me with regular Click Pages, but= when I try to use a Panel, I get<br> &gt; =A0 =A0 errors of this nature:<br> &gt;<br> &gt; =A0 =A0 [Click] [error] Velocity: Parser Exception:<br> &gt; =A0 =A0 /mypath/mypanel-template.jsporg.apache.velocity.runtime.parser= .ParseException: Encountered<br> &gt; =A0 =A0 &quot;:length(userLinks)}\n&lt;div&gt;<br> &gt;<br> &gt; =A0 =A0 userLinks is an Array&lt;PageLink&gt; which I&#39;ve defined i= n my Panel.java subclass, and am referencing<br> &gt; =A0 =A0 in the JSP as shown in the error, so it is reaching the JSP. = =A0But it seems like Click is trying<br> &gt; =A0 =A0 to interpret the template as Velocity instead of JSP, even tho= ugh I&#39;ve overridden the Page&#39;s<br> &gt; =A0 =A0 getTemplate() method to return a jsp file name (as demonstrate= d by the fact that it reaches the<br> &gt; =A0 =A0 jsp!).<br> &gt;<br> &gt; =A0 =A0 Any advice or examples would be much appreciated.<br> &gt;<br> &gt; =A0 =A0 Thanks,<br> &gt; =A0 =A0 Ari<br> &gt;<br> &gt;<br> <br> </div></div></blockquote></div><br> --20cf3071cd789a3c2c049d983206-- From charles17@example.com Fri Mar 04 07:32:08 2011 Return-Path: <charles17@example.com> Delivered-To: charles17@example.com Received: (qmail 11552 invoked from network); 4 Mar 2011 07:32:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Mar 2011 07:32:08 -0000 Received: (qmail 75936 invoked by uid 500); 4 Mar 2011 07:32:07 -0000 Delivered-To: charles17@example.com Received: (qmail 75903 invoked by uid 500); 4 Mar 2011 07:32:07 -0000 Mailing-List: contact charles17@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:charles17@example.com> List-Unsubscribe: <mailto:charles17@example.com> List-Post: <mailto:charles17@example.com> List-Id: <user.click.apache.org> Reply-To: charles17@example.com Delivered-To: mailing list charles17@example.com Received: (qmail 75891 invoked by uid 99); 4 Mar 2011 07:32:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 07:32:06 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of charles17@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-gx0-f170.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 07:32:00 +0000 Received: by gxk1 with SMTP id 1so741042gxk.29 for <charles17@example.com>; Thu, 03 Mar 2011 23:31:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=XkXdDRKkGfJTwa68Y9E6Tie/GrTQys3b2wcyNtUKIp4=; b=m0NPK57yDN0sINPpTpdpnyZBYWX18PGIvqd4iXP2qGgGZrOuC/6TBFYSRldPA60weF DPCB71jJGjRPgt7RcbQvuX+kZFlMZcD7LYU6GnPMYN7WoUbQ+VPAOomrT1XM2AdmmS61 Q0wTXDlZ+0t2fO55ddFHK5a0IgHkAn4qBsyrA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=MPlsJFQLkQvgad9+fCTk2kEUog/UWDpWH3E2kK+G2ODv2C3lh8ifHdPxnPozKkIOvB Es/NLYr1BI2NFrW16qXLv1kd5/W7NijHHIGnyPh4cKQlwDfUFrSIVldy4kga4XWbPJ33 LEGRMGs6QHnVL2y6PwzryIng2wrpXbaSvectw= Received: by 83.161.120.155 with SMTP id e16mr437354agq.187.1299223899526; Thu, 03 Mar 2011 23:31:39 -0800 (PST) Received: from [83.161.120.155] ([83.161.120.155]) by mx.google.com with ESMTPS id 17sm86325anx.13.283.161.120.155.31.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Mar 2011 23:31:38 -0800 (PST) Message-ID: <charles17@example.com> Date: Fri, 04 Mar 2011 09:31:31 +0200 From: Bob Schellink <charles17@example.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:83.161.120.155) Gecko/20110221 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: charles17@example.com Subject: Re: example of Panel with jsp References: <charles17@example.com> <charles17@example.com> <charles17@example.com> <charles17@example.com> In-Reply-To: <charles17@example.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Context is bound to a ThreadLocal so you can just look it up. No need to change method signatures. Bob On 2011/03/03 20:28 PM, Ari wrote: > Hi, > > In that case, what do you think about changing the TemplateService.renderTemplate() signature to > allow the Context to be passed in? > > Velocity and Freemarker TemplateServices would just ignore it and function exactly as before (they > could trivially implement the new signature by just calling the old one with a null), but a new > JspTemplateService could now use this Context to get the HttpServletRequest and Response, which > would allow it to render the Jsp normally via RequestDispatcher.include() > > If writing to an intermediate String is preferred instead of writing directly to output stream then > a mock HttpServletResponse can be passed in. This mock instance would implement the > HttpServletResponse methods but would internally write to a StringWriter instead of the > OutputStream. HttpServletResponseWrapper would make a handy starting point for writing such a class. > > Thoughts? Should I repost in the dev forum? > > Thanks > Ari > > > On Thu, Mar 3, 2011 at 2:07 AM, Bob Schellink <charles17@example.com <mailto:charles17@example.com>> wrote: > > Hi, > > I'm not sure if that is possible actually. The question is how would you render the JSP template to > a String which the Panel can return. If you know of a way you can create a custom Panel to achieve > that. One route might be to create a custom HttpServletResponse using a ByteArray which you then > forward to the container's JSP engine. Once it returns the byteArray should contain the content. > > Bob > > > On 2011/03/03 04:14 AM, Ari wrote: > > Minor corrections to my own question... > > > > 1) userLinks is a List<PageLink>, not an array. > > > > 2) I've overridden the Panel's getTemplate(), not the Page's. The page merely includes the Panel > > like any other component. > > > > Thanks again for any suggestions as to what might be wrong. > > > > Ari > > > > On Wed, Mar 2, 2011 at 4:40 PM, Ari <charles17@example.com > <mailto:charles17@example.com> <mailto:charles17@example.com > <mailto:charles17@example.com>>> > > wrote: > > > > Hi, > > > > I wondered if someone might have a working example of a Panel being used with a JSP as its > view > > template. JSPs work ok for me with regular Click Pages, but when I try to use a Panel, I get > > errors of this nature: > > > > [Click] [error] Velocity: Parser Exception: > > /mypath/mypanel-template.jsporg.apache.velocity.runtime.parser.ParseException: Encountered > > ":length(userLinks)}\n<div> > > > > userLinks is an Array<PageLink> which I've defined in my Panel.java subclass, and am > referencing > > in the JSP as shown in the error, so it is reaching the JSP. But it seems like Click is > trying > > to interpret the template as Velocity instead of JSP, even though I've overridden the Page's > > getTemplate() method to return a jsp file name (as demonstrated by the fact that it > reaches the > > jsp!). > > > > Any advice or examples would be much appreciated. > > > > Thanks, > > Ari > > > > > > From charles17@example.com Fri Mar 04 14:16:17 2011 Return-Path: <charles17@example.com> Delivered-To: charles17@example.com Received: (qmail 30702 invoked from network); 4 Mar 2011 14:16:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Mar 2011 14:16:17 -0000 Received: (qmail 35522 invoked by uid 500); 4 Mar 2011 14:16:17 -0000 Delivered-To: charles17@example.com Received: (qmail 35502 invoked by uid 500); 4 Mar 2011 14:16:17 -0000 Mailing-List: contact charles17@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:charles17@example.com> List-Unsubscribe: <mailto:charles17@example.com> List-Post: <mailto:charles17@example.com> List-Id: <user.click.apache.org> Reply-To: charles17@example.com Delivered-To: mailing list charles17@example.com Received: (qmail 35491 invoked by uid 99); 4 Mar 2011 14:16:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 14:16:17 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO composersnotebook.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 14:16:09 +0000 Received: from mail-vw0-f42.google.com ([83.161.120.155]) by cp46.myhostcenter.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.69) (envelope-from <charles17@example.com>) id 1PvVnH-0000WJ-Nn for charles17@example.com; Fri, 04 Mar 2011 09:15:47 -0500 Received: by vws10 with SMTP id 10so1998922vws.29 for <charles17@example.com>; Fri, 04 Mar 2011 06:15:44 -0800 (PST) MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id cv6mr981009vdb.217.1299248144818; Fri, 04 Mar 2011 06:15:44 -0800 (PST) Received: by 83.161.120.155 with HTTP; Fri, 4 Mar 2011 06:15:44 -0800 (PST) In-Reply-To: <charles17@example.com> References: <charles17@example.com> <charles17@example.com> <charles17@example.com> <charles17@example.com> <charles17@example.com> Date: Fri, 4 Mar 2011 09:15:44 -0500 Message-ID: <charles17@example.com> Subject: Re: example of Panel with jsp From: Ari <charles17@example.com> To: charles17@example.com Content-Type: multipart/alternative; boundary=bcaec501615125a0cf049da8c829 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cp46.myhostcenter.com X-AntiAbuse: Original Domain - click.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - composersnotebook.com X-Virus-Checked: Checked by ClamAV on apache.org --bcaec501615125a0cf049da8c829 Content-Type: text/plain; charset=ISO-8859-1 Ah, even better. So using this approach I now have Panels rendering fine with jsp templates, by way of a custom JspTemplateService. I'll look into contributing a patch for this in JIRA... do you suppose this belongs in framework next to VelocityTemplateService, or in extras next to the FreemarkerTemplateService? On Fri, Mar 4, 2011 at 2:31 AM, Bob Schellink <charles17@example.com> wrote: > Context is bound to a ThreadLocal so you can just look it up. No need to > change method signatures. > > Bob > > On 2011/03/03 20:28 PM, Ari wrote: > > Hi, > > > > In that case, what do you think about changing the > TemplateService.renderTemplate() signature to > > allow the Context to be passed in? > > > > Velocity and Freemarker TemplateServices would just ignore it and > function exactly as before (they > > could trivially implement the new signature by just calling the old one > with a null), but a new > > JspTemplateService could now use this Context to get the > HttpServletRequest and Response, which > > would allow it to render the Jsp normally via RequestDispatcher.include() > > > > If writing to an intermediate String is preferred instead of writing > directly to output stream then > > a mock HttpServletResponse can be passed in. This mock instance would > implement the > > HttpServletResponse methods but would internally write to a StringWriter > instead of the > > OutputStream. HttpServletResponseWrapper would make a handy starting > point for writing such a class. > > > > Thoughts? Should I repost in the dev forum? > > > > Thanks > > Ari > > > > > > On Thu, Mar 3, 2011 at 2:07 AM, Bob Schellink <charles17@example.com <mailto: > charles17@example.com>> wrote: > > > > Hi, > > > > I'm not sure if that is possible actually. The question is how would > you render the JSP template to > > a String which the Panel can return. If you know of a way you can > create a custom Panel to achieve > > that. One route might be to create a custom HttpServletResponse using > a ByteArray which you then > > forward to the container's JSP engine. Once it returns the byteArray > should contain the content. > > > > Bob > > > > > > On 2011/03/03 04:14 AM, Ari wrote: > > > Minor corrections to my own question... > > > > > > 1) userLinks is a List<PageLink>, not an array. > > > > > > 2) I've overridden the Panel's getTemplate(), not the Page's. The > page merely includes the Panel > > > like any other component. > > > > > > Thanks again for any suggestions as to what might be wrong. > > > > > > Ari > > > > > > On Wed, Mar 2, 2011 at 4:40 PM, Ari <charles17@example.com > > <mailto:charles17@example.com> <mailto:charles17@example.com > > <mailto:charles17@example.com>>> > > > wrote: > > > > > > Hi, > > > > > > I wondered if someone might have a working example of a Panel > being used with a JSP as its > > view > > > template. JSPs work ok for me with regular Click Pages, but > when I try to use a Panel, I get > > > errors of this nature: > > > > > > [Click] [error] Velocity: Parser Exception: > > > > /mypath/mypanel-template.jsporg.apache.velocity.runtime.parser.ParseException: > Encountered > > > ":length(userLinks)}\n<div> > > > > > > userLinks is an Array<PageLink> which I've defined in my > Panel.java subclass, and am > > referencing > > > in the JSP as shown in the error, so it is reaching the JSP. > But it seems like Click is > > trying > > > to interpret the template as Velocity instead of JSP, even > though I've overridden the Page's > > > getTemplate() method to return a jsp file name (as demonstrated > by the fact that it > > reaches the > > > jsp!). > > > > > > Any advice or examples would be much appreciated. > > > > > > Thanks, > > > Ari > > > > > > > > > > > > --bcaec501615125a0cf049da8c829 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ah, even better.=A0 So using this approach I now have Panels rendering fine= with jsp templates, by way of a custom JspTemplateService.<br><br>I&#39;ll= look into contributing a patch for this in JIRA... do you suppose this bel= ongs in framework next to VelocityTemplateService, or in extras next to the= FreemarkerTemplateService? <br> <br><br><br><div class=3D"gmail_quote">On Fri, Mar 4, 2011 at 2:31 AM, Bob = Schellink <span dir=3D"ltr">&lt;<a href=3D"mailto:charles17@example.com">sabob1@= gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style= =3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); p= adding-left: 1ex;"> Context is bound to a ThreadLocal so you can just look it up. No need to ch= ange method signatures.<br> <br> Bob<br> <div class=3D"im"><br> On 2011/03/03 20:28 PM, Ari wrote:<br> &gt; Hi,<br> &gt;<br> &gt; In that case, what do you think about changing the TemplateService.ren= derTemplate() signature to<br> &gt; allow the Context to be passed in?<br> &gt;<br> &gt; Velocity and Freemarker TemplateServices would just ignore it and func= tion exactly as before (they<br> &gt; could trivially implement the new signature by just calling the old on= e with a null), but a new<br> &gt; JspTemplateService could now use this Context to get the HttpServletRe= quest and Response, which<br> &gt; would allow it to render the Jsp normally via RequestDispatcher.includ= e()<br> &gt;<br> &gt; If writing to an intermediate String is preferred instead of writing d= irectly to output stream then<br> &gt; a mock HttpServletResponse can be passed in. =A0This mock instance wou= ld implement the<br> &gt; HttpServletResponse methods but would internally write to a StringWrit= er instead of the<br> &gt; OutputStream. =A0HttpServletResponseWrapper would make a handy startin= g point for writing such a class.<br> &gt;<br> &gt; Thoughts? =A0Should I repost in the dev forum?<br> &gt;<br> &gt; Thanks<br> &gt; Ari<br> &gt;<br> &gt;<br> </div><div class=3D"im">&gt; On Thu, Mar 3, 2011 at 2:07 AM, Bob Schellink = &lt;<a href=3D"mailto:charles17@example.com">charles17@example.com</a> &lt;mailto:<a = href=3D"mailto:charles17@example.com">charles17@example.com</a>&gt;&gt; wrote:<br> &gt;<br> &gt; =A0 =A0 Hi,<br> &gt;<br> &gt; =A0 =A0 I&#39;m not sure if that is possible actually. The question is= how would you render the JSP template to<br> &gt; =A0 =A0 a String which the Panel can return. If you know of a way you = can create a custom Panel to achieve<br> &gt; =A0 =A0 that. One route might be to create a custom HttpServletRespons= e using a ByteArray which you then<br> &gt; =A0 =A0 forward to the container&#39;s JSP engine. Once it returns the= byteArray should contain the content.<br> &gt;<br> &gt; =A0 =A0 Bob<br> &gt;<br> &gt;<br> &gt; =A0 =A0 On 2011/03/03 04:14 AM, Ari wrote:<br> &gt; =A0 =A0 &gt; Minor corrections to my own question...<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; 1) userLinks is a List&lt;PageLink&gt;, not an array.<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; 2) I&#39;ve overridden the Panel&#39;s getTemplate(), not= the Page&#39;s. =A0The page merely includes the Panel<br> &gt; =A0 =A0 &gt; like any other component.<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; Thanks again for any suggestions as to what might be wron= g.<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; Ari<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; On Wed, Mar 2, 2011 at 4:40 PM, Ari &lt;<a href=3D"mailto= :charles17@example.com">charles17@example.com</a><br> </div>&gt; =A0 =A0 &lt;mailto:<a href=3D"mailto:charles17@example.com">= charles17@example.com</a>&gt; &lt;mailto:<a href=3D"mailto:ari@composer= snotebook.com">charles17@example.com</a><br> <div><div></div><div class=3D"h5">&gt; =A0 =A0 &lt;mailto:<a href=3D"mailto= :charles17@example.com">charles17@example.com</a>&gt;&gt;&gt;<br> &gt; =A0 =A0 &gt; wrote:<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; =A0 =A0 Hi,<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; =A0 =A0 I wondered if someone might have a working exampl= e of a Panel being used with a JSP as its<br> &gt; =A0 =A0 view<br> &gt; =A0 =A0 &gt; =A0 =A0 template. =A0JSPs work ok for me with regular Cli= ck Pages, but when I try to use a Panel, I get<br> &gt; =A0 =A0 &gt; =A0 =A0 errors of this nature:<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; =A0 =A0 [Click] [error] Velocity: Parser Exception:<br> &gt; =A0 =A0 &gt; =A0 =A0 /mypath/mypanel-template.jsporg.apache.velocity.r= untime.parser.ParseException: Encountered<br> &gt; =A0 =A0 &gt; =A0 =A0 &quot;:length(userLinks)}\n&lt;div&gt;<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; =A0 =A0 userLinks is an Array&lt;PageLink&gt; which I&#39= ;ve defined in my Panel.java subclass, and am<br> &gt; =A0 =A0 referencing<br> &gt; =A0 =A0 &gt; =A0 =A0 in the JSP as shown in the error, so it is reachi= ng the JSP. =A0But it seems like Click is<br> &gt; =A0 =A0 trying<br> &gt; =A0 =A0 &gt; =A0 =A0 to interpret the template as Velocity instead of = JSP, even though I&#39;ve overridden the Page&#39;s<br> &gt; =A0 =A0 &gt; =A0 =A0 getTemplate() method to return a jsp file name (a= s demonstrated by the fact that it<br> &gt; =A0 =A0 reaches the<br> &gt; =A0 =A0 &gt; =A0 =A0 jsp!).<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; =A0 =A0 Any advice or examples would be much appreciated.= <br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt; =A0 =A0 Thanks,<br> &gt; =A0 =A0 &gt; =A0 =A0 Ari<br> &gt; =A0 =A0 &gt;<br> &gt; =A0 =A0 &gt;<br> &gt;<br> &gt;<br> <br> </div></div></blockquote></div><br> --bcaec501615125a0cf049da8c829-- From charles17@example.com Fri Mar 04 18:09:13 2011 Return-Path: <charles17@example.com> Delivered-To: charles17@example.com Received: (qmail 27623 invoked from network); 4 Mar 2011 18:09:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Mar 2011 18:09:13 -0000 Received: (qmail 18635 invoked by uid 500); 4 Mar 2011 18:09:13 -0000 Delivered-To: charles17@example.com Received: (qmail 18618 invoked by uid 500); 4 Mar 2011 18:09:13 -0000 Mailing-List: contact charles17@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:charles17@example.com> List-Unsubscribe: <mailto:charles17@example.com> List-Post: <mailto:charles17@example.com> List-Id: <user.click.apache.org> Reply-To: charles17@example.com Delivered-To: mailing list charles17@example.com Received: (qmail 18608 invoked by uid 99); 4 Mar 2011 18:09:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 18:09:13 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of charles17@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-qw0-f42.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 18:09:09 +0000 Received: by qwd6 with SMTP id 6so1878092qwd.29 for <charles17@example.com>; Fri, 04 Mar 2011 10:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=LyNKWPYgyiVTGp+fLH2fivsKbyFLmRzJ6nM2CAkETX0=; b=naGB1cAekcxISjeHvTIsRRPsjMYIbrO6pCnAQuPQIw1dzFz21OXZEN4t827xVLsoHT HAitzG8aBaNZiT9zBBM5wyAydXEPOkQRWe5ocXa7USsKIYEo9RX8RS1M6zUGY52cX9Fs vx+XuBPp6Tzgf0Azw0mEc7TvrRJ1zq0lsyVqI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=lI30kdUtEGA9iSFWsM3MA5CVy9HtrHg9BgioNXZCBQLeZQd0CMyD1SeaWNklK3/xjn gLlV4pwy8zr19AB2rcSYFtsmOvqs+lTJL8KanzSttvmyLAoDdRb4DqekbKdfEx2jLSer p1ugoeTMgpLuZYtLTrfpZVjNcrgZDBL4zkN0M= MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id z23mr814937qcq.2.1299262128041; Fri, 04 Mar 2011 10:08:48 -0800 (PST) Received: by 83.161.120.155 with HTTP; Fri, 4 Mar 2011 10:08:47 -0800 (PST) Date: Fri, 4 Mar 2011 15:08:47 -0300 Message-ID: <charles17@example.com> Subject: Form Layout [fieldset control] From: Gilberto <charles17@example.com> To: charles17@example.com Content-Type: text/plain; charset=UTF-8 Hi, Is it possible to set the form layout without using the template approach[1]? Here is the original idea[2], which I've done with the pencil firefox plugin[2.1]. This one[3] is the result of my effort with Apache Click. Any tip will be appreciated. Regards, Gilberto [1]http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#template-layout [2]http://dl.dropbox.com/u/9093640/EditLegalEntity_pencil.png [2.1]http://pencil.evolus.vn/en-US/Home.aspx [3]http://dl.dropbox.com/u/9093640/EditLegalEntity_click.png [3.1]http://code.google.com/p/construtor/source/browse/trunk/cip/park/src/main/java/park/web/page/EditLegalEntity.java From charles17@example.com Sat Mar 05 05:41:54 2011 Return-Path: <charles17@example.com> Delivered-To: charles17@example.com Received: (qmail 88795 invoked from network); 5 Mar 2011 05:41:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Mar 2011 05:41:53 -0000 Received: (qmail 95961 invoked by uid 500); 5 Mar 2011 05:41:53 -0000 Delivered-To: charles17@example.com Received: (qmail 95917 invoked by uid 500); 5 Mar 2011 05:41:52 -0000 Mailing-List: contact charles17@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:charles17@example.com> List-Unsubscribe: <mailto:charles17@example.com> List-Post: <mailto:charles17@example.com> List-Id: <user.click.apache.org> Reply-To: charles17@example.com Delivered-To: mailing list charles17@example.com Received: (qmail 95888 invoked by uid 99); 5 Mar 2011 05:41:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Mar 2011 05:41:51 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of charles17@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO mail-iy0-f170.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Mar 2011 05:41:42 +0000 Received: by iyb12 with SMTP id 12so2650356iyb.29 for <charles17@example.com>; Fri, 04 Mar 2011 21:41:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=F01fuIHT6xJ1jFbad3467x4Yg4Ih6aMMVU5eA0x4cgk=; b=bDphM0BaM+t6OY05C4GZGXPZ8SDjIM0+GzPSkFEaa5I0nP5Hgk4cKCGxTbm17oivVm ROmeLskgelTsx/UYBEO3MrJOadHNOStlx+0JJDk0jTm+xdiAmal/qFRLYgsk/uCh0QXr P8def3bLpTJ70CalK+MOwobCWeyDiB1mjfu54= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=R2mkEWOE+0pP9eUk00ixMb5M8XM0eF+ATv/hsgFXo3U0xILENxTkY2v+9NIfzuTn/N M0mdlhdmsKSvOn0utYmoayZ4MMnH++WVzVieXSGJZWCn3oWUguelc0eofTSZXzt6h2EE 5Sxz7e9Ot1sAyZZJXGifQWVM43kDWJ6kAkiGU= Received: by 83.161.120.155 with SMTP id l7mr1165652ict.234.1299303681235; Fri, 04 Mar 2011 21:41:21 -0800 (PST) Received: from [83.161.120.155] ([83.161.120.155]) by mx.google.com with ESMTPS id c4sm174437ict.7.283.161.120.155.41.15 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 21:41:17 -0800 (PST) Message-ID: <charles17@example.com> Date: Sat, 05 Mar 2011 07:41:11 +0200 From: Bob Schellink <charles17@example.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:83.161.120.155) Gecko/20110221 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: charles17@example.com Subject: Re: Form Layout [fieldset control] References: <charles17@example.com> In-Reply-To: <charles17@example.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 2011/03/04 20:08 PM, Gilberto wrote: > Hi, > > Is it possible to set the form layout without using the template approach[1]? You can also use a programmatic approach but the template approach (declarative) is more common and easier to understand. Bob From charles17@example.com Sun Mar 06 15:27:21 2011 Return-Path: <charles17@example.com> Delivered-To: charles17@example.com Received: (qmail 95063 invoked from network); 6 Mar 2011 15:27:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Mar 2011 15:27:21 -0000 Received: (qmail 17463 invoked by uid 500); 6 Mar 2011 15:27:21 -0000 Delivered-To: charles17@example.com Received: (qmail 17431 invoked by uid 500); 6 Mar 2011 15:27:20 -0000 Mailing-List: contact charles17@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:charles17@example.com> List-Unsubscribe: <mailto:charles17@example.com> List-Post: <mailto:charles17@example.com> List-Id: <user.click.apache.org> Reply-To: charles17@example.com Delivered-To: mailing list charles17@example.com Received: (qmail 17420 invoked by uid 99); 6 Mar 2011 15:27:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Mar 2011 15:27:20 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [83.161.120.155] (HELO composersnotebook.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Mar 2011 15:27:14 +0000 Received: from mail-vw0-f42.google.com ([83.161.120.155]) by cp46.myhostcenter.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.69) (envelope-from <charles17@example.com>) id 1PwFrA-0001Oe-Fe for charles17@example.com; Sun, 06 Mar 2011 10:26:52 -0500 Received: by vws10 with SMTP id 10so3167897vws.29 for <charles17@example.com>; Sun, 06 Mar 2011 07:26:49 -0800 (PST) MIME-Version: 1.0 Received: by 83.161.120.155 with SMTP id dv1mr780869vcb.105.1299425209477; Sun, 06 Mar 2011 07:26:49 -0800 (PST) Received: by 83.161.120.155 with HTTP; Sun, 6 Mar 2011 07:26:49 -0800 (PST) In-Reply-To: <charles17@example.com> References: <charles17@example.com> <charles17@example.com> <charles17@example.com> <charles17@example.com> Date: Sun, 6 Mar 2011 10:26:49 -0500 Message-ID: <charles17@example.com> Subject: Re: How to redirect to the desired page after successful login? From: Ari <charles17@example.com> To: charles17@example.com Content-Type: multipart/alternative; boundary=90e6ba53aab205e96f049dd2020c X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cp46.myhostcenter.com X-AntiAbuse: Original Domain - click.apache.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - composersnotebook.com --90e6ba53aab205e96f049dd2020c Content-Type: text/plain; charset=ISO-8859-1 Hello Haim, This document directly speaks to your question: http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html It describes how to weave in a database or other dynamic data store into the Tomcat security API that the Click default example is using. Best Ari On Tue, Mar 1, 2011 at 5:37 AM, Bob Schellink <charles17@example.com> wrote: > Hi, > > Click is built on top of Java Servlet API so that doco assumes familiarity > with Servlet security. > > If you are not familiar with Java Servlet Security you will find many books > or articles describing > the standard. Also note that the standard is quite loose on the > implementation and each container is > free to provide it's own implementation. So if you use Tomcat you should > see the Tomcat doco, same > for JBoss etc. Many people opt to use an alternative security to the > standard such as Spring > Security or Apache Shiro. > > Hope this helps. > > Bob > > On 2011/03/01 00:06 AM, Haim Schindler wrote: > > Hi, > > > > I have read: > > > > > http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#security > > > > but beside the definitions in web.xml file, I could not figure out how > the logic of authentication > > works. > > where is the logic that works against the database ? > > where and how are the users & passwords are stored ? > > who is handling the POST request from the login form ? > > > > Haim > > > > > > On Sun, Feb 20, 2011 at 11:37 PM, Bob Schellink <charles17@example.com<mailto: > charles17@example.com>> wrote: > > > > Hi, > > > > The scenario you describe is pretty much how Servlet security > works[1]. You can also use these > > alternatives[2]. > > > > Bob > > > > [1]: > http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#security > > [2]: > > > http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#alternatve-security-solutions > > > > On 2011/02/20 17:17 PM, Haim Schindler wrote: > > > Hello, > > > > > > What is the right way in click to redirect to a desired page after > successful login? > > > > > > *here is the scenario:* > > > > > > user type in the browser url: > > > > > > *www.site.com/page1000.htm <http://www.site.com/page1000.htm> < > http://www.site.com/page1000.htm>* > > > > > > but user is NOT login so he was redirected to > > > > > > *www.site.com/login.htm <http://www.site.com/login.htm> < > http://www.site.com/login.htm>* > > > > > > after successful login I want the user to be automatically > redirected to > > > > > > *www.site.com/page1000.htm <http://www.site.com/page1000.htm> > > <http://www.site.com/page1000.htm> * (the original url that the > user wanted) > > > > > > (now what I do is a bit tedios, I keep this information the the url > to login.htm?.... and then > > I use > > > hidden fields in the login form so that info goes to login process > after post....) > > > > > > > > > --90e6ba53aab205e96f049dd2020c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello Haim,<br><br>This document directly speaks to your question:<br><br>= =A0=A0=A0 <a href=3D"http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.ht= ml">http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html</a><br><br>It = describes how to weave in a database or other dynamic data store into the T= omcat security API that the Click default example is using.<br> <br>Best<br>Ari<br><br><br><div class=3D"gmail_quote">On Tue, Mar 1, 2011 a= t 5:37 AM, Bob Schellink <span dir=3D"ltr">&lt;<a href=3D"mailto:sabob1@gma= il.com">charles17@example.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmai= l_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204= , 204, 204); padding-left: 1ex;"> Hi,<br> <br> Click is built on top of Java Servlet API so that doco assumes familiarity = with Servlet security.<br> <br> If you are not familiar with Java Servlet Security you will find many books= or articles describing<br> the standard. Also note that the standard is quite loose on the implementat= ion and each container is<br> free to provide it&#39;s own implementation. So if you use Tomcat you shoul= d see the Tomcat doco, same<br> for JBoss etc. Many people opt to use an alternative security to the standa= rd such as Spring<br> Security or Apache Shiro.<br> <br> Hope this helps.<br> <br> Bob<br> <div class=3D"im"><br> On 2011/03/01 00:06 AM, Haim Schindler wrote:<br> &gt; Hi,<br> &gt;<br> &gt; I have read:<br> &gt;<br> &gt; =A0 =A0<a href=3D"http://click.apache.org/docs/user-guide/htmlsingle/c= lick-book.html#security" target=3D"_blank">http://click.apache.org/docs/use= r-guide/htmlsingle/click-book.html#security</a><br> &gt;<br> &gt; but beside the definitions in web.xml file, I could not figure out how= the logic of authentication<br> &gt; works.<br> &gt; where is the logic that works against the database ?<br> &gt; where and how are the users &amp; passwords are stored ?<br> &gt; who is handling the POST request from the login form ?<br>
{'source': 'Apache Software Foundation Public Mail Archives'}