Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 71129 invoked from network); 21 Aug 2007 22:32:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Aug 2007 22:32:16 -0000 Received: (qmail 65706 invoked by uid 500); 21 Aug 2007 22:32:05 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 64812 invoked by uid 500); 21 Aug 2007 22:32:02 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 64801 invoked by uid 99); 21 Aug 2007 22:32:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 15:32:02 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paulus.benedictus@gmail.com designates 209.85.132.243 as permitted sender) Received: from [209.85.132.243] (HELO an-out-0708.google.com) (209.85.132.243) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2007 22:32:02 +0000 Received: by an-out-0708.google.com with SMTP id c37so202196anc for ; Tue, 21 Aug 2007 15:31:41 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=quFQnPHC3RIeSbG4k1ZZYtW4zjSMKvLR+Sa5tEYNoIwB7vlLLdBxlI7ldswGr1RS1aD7IO2eU4zVpdLiffYX8JXvc5mNzNnqkUk9x8UsbT8VOXLYCQpWOuvqYdjVosMxGwmISPAE5MhCMBd9+zqECzVG92e2Se7H2v/SyKYOQok= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=lg6oDYd34wqEbFliXSUJoTeqdVxB38pxOvDxWv+xJLC2iREjisF7Iflqb2V6bxlnvJ+8mnm65lO3gJz59049QgGd0ggLGvzikdWGWcz7NhUSsUki680/PVBi/YZATaH5khCZ3+f/d1YWnbcrsMFC96kxQMUfxH31H3HLXyoJVe4= Received: by 10.78.149.13 with SMTP id w13mr3097963hud.1187735500159; Tue, 21 Aug 2007 15:31:40 -0700 (PDT) Received: by 10.67.15.18 with HTTP; Tue, 21 Aug 2007 15:31:40 -0700 (PDT) Message-ID: Date: Tue, 21 Aug 2007 17:31:40 -0500 From: "Paul Benedict" Sender: paulus.benedictus@gmail.com To: "Struts Users Mailing List" Subject: Re: Tiles: definition without path In-Reply-To: <0FC83975F7488E43A624833ED07E38DB01DF5D2B@MIANTEX1.mia.usa.sinvest> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_71161_26951180.1187735500100" References: <0FC83975F7488E43A624833ED07E38DB01DF5D2B@MIANTEX1.mia.usa.sinvest> X-Google-Sender-Auth: e19702e7cdbd0521 X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_71161_26951180.1187735500100 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I'll have to investigate this. On 8/21/07, Jose Luis Martinez Avial wrote: > > The question is that I don't need to forward to a JSP. The controller > takes the HttpServletResponse and writes in it, and that is the response > to the user. Before that I put the image as an attribute in the request, > and in a JSP template I recovered it form the request, and wrote it, but > the tomcat always said that the Output stream had already been closed. > > Is there anyway to return a image to the user using a controller without > using a JSP? > > > -----Original Message----- > From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com] > On Behalf Of Paul Benedict > Sent: Tuesday, August 21, 2007 18:18 PM > To: Struts Users Mailing List > Subject: Re: Tiles: definition without path > > I don't understand why you haven't provided a path attribute on the > definition. Definitions need to resolve to a resource. I don't see a JSP > listed. > > On 8/21/07, Jose Luis Martinez Avial > wrote: > > > > I'm using Struts 1.3.9, with Tiles. I've one action that calls to a > > definition > > struts-config.xml > > > forward="verGraphPortfolio.pantalla"/> > > > > riles-def..xml > > > > controllerClass="com.bpi.isis.customer.web.vista.PortfolioValGraphContro > > ller"/> > > > > In the PortfolioValGraphController I have this code > > > > .... > > response.setHeader("Content-Disposition", "inline"); > > response.setHeader("Cache-Control", "no-cache"); > > response.setHeader("Cache-Control", "no-store"); > > response.setHeader("Cache-Control", > "must-revalidate"); > > response.getOutputStream().write(baos.toByteArray()); > > response.getOutputStream().flush(); > > response.getOutputStream().close(); > > response.setStatus(HttpServletResponse.SC_OK); > > baos.close(); > > baos = null; > > ..... > > > > If I don't put the path attribute in the definition, the controller is > > not invocated and the user doesn't see the image. In the logs your can > > see this: > > > > 21 Aug 2007 13:11:36,711 DEBUG > > org.apache.struts.tiles.ComponentDefinition - Controller created : > > com.bpi.isis.customer.web.vista.PortfolioValGraphController@20f237 > > 21 Aug 2007 13:11:36,711 DEBUG > > org.apache.struts.tiles.commands.TilesPreProcessor - no uri computed, > > so pass to next command > > 21 Aug 2007 13:11:36,711 DEBUG > > org.apache.struts.chain.commands.ActionCommandBase - Executing > > org.apache.struts.chain.commands.servlet.PerformForward > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.util.RequestUtils - > > No actionId found for verGraphPortfolio.pantalla > > 21 Aug 2007 13:11:36,711 DEBUG > > org.apache.struts.chain.commands.ExceptionCatcher - Attempting to > > handle a thrown exception > > 21 Aug 2007 13:11:36,711 DEBUG > > org.apache.struts.chain.commands.ExceptionCatcher - Calling > > exceptionCommand 'servlet-exception' > > 21 Aug 2007 13:11:36,711 DEBUG > > org.apache.struts.chain.commands.ActionCommandBase - Executing > > org.apache.struts.chain.commands.servlet.ExceptionHandler > > 21 Aug 2007 13:11:36,711 DEBUG > > org.apache.struts.chain.commands.AbstractExceptionHandler - See if > > actionConfig > > > ActionConfig[cancellable=false,path=/customer/verGraphPortfolio,validate > > =true,forward=verGraphPortfolio.pantalla,scope=session has an > > exceptionConfig for java.lang.IllegalArgumentException > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look locally for java.lang.IllegalArgumentException > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look globally for java.lang.IllegalArgumentException > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look locally for java.lang.RuntimeException > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look globally for java.lang.RuntimeException > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look locally for java.lang.Exception > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look globally for java.lang.Exception > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look locally for java.lang.Throwable > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look globally for java.lang.Throwable > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look locally for java.lang.Object > > 21 Aug 2007 13:11:36,711 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look globally for java.lang.Object > > 21 Aug 2007 13:11:36,711 WARN > > org.apache.struts.chain.commands.AbstractExceptionHandler - Unhandled > > exception > > java.lang.IllegalArgumentException: Path verGraphPortfolio.pantalla > does > > not start with a "/" character > > at > > > org.apache.catalina.core.ApplicationContext.getRequestDispatcher(Applica > > tionContext.java:379) > > at > > > org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(A > > pplicationContextFacade.java:195) > > at > > > org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward( > > PerformForward.java:107) > > at > > > org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformF > > orward.java:96) > > > > > > > > > > If I put path = "", then the controller is invocated, and the user see > > the image, but you see this logs > > 21 Aug 2007 13:11:28,320 INFO > > org.apache.struts.tiles.commands.TilesPreProcessor - Tiles process > > complete; forward to > > 21 Aug 2007 13:11:28,320 DEBUG > > org.apache.struts.chain.commands.ExceptionCatcher - Attempting to > > handle a thrown exception > > 21 Aug 2007 13:11:28,320 DEBUG > > org.apache.struts.chain.commands.ExceptionCatcher - Calling > > exceptionCommand 'servlet-exception' > > 21 Aug 2007 13:11:28,320 DEBUG > > org.apache.struts.chain.commands.ActionCommandBase - Executing > > org.apache.struts.chain.commands.servlet.ExceptionHandler > > 21 Aug 2007 13:11:28,320 DEBUG > > org.apache.struts.chain.commands.AbstractExceptionHandler - See if > > actionConfig > > > ActionConfig[cancellable=false,path=/divisas/verGraphExchRate,validate=t > > rue,forward=verGraphExchRate.pantalla,scope=session has an > > exceptionConfig for java.lang.IllegalArgumentException > > 21 Aug 2007 13:11:28,320 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look locally for java.lang.IllegalArgumentException > > 21 Aug 2007 13:11:28,320 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look globally for java.lang.IllegalArgumentException > > 21 Aug 2007 13:11:28,320 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look locally for java.lang.RuntimeException > > 21 Aug 2007 13:11:28,320 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look globally for java.lang.RuntimeException > > 21 Aug 2007 13:11:28,320 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look locally for java.lang.Exception > > 21 Aug 2007 13:11:28,320 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look globally for java.lang.Exception > > 21 Aug 2007 13:11:28,320 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look locally for java.lang.Throwable > > 21 Aug 2007 13:11:28,320 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look globally for java.lang.Throwable > > 21 Aug 2007 13:11:28,320 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look locally for java.lang.Object > > 21 Aug 2007 13:11:28,320 DEBUG org.apache.struts.config.ActionConfig > - > > findException: look globally for java.lang.Object > > 21 Aug 2007 13:11:28,320 WARN > > org.apache.struts.chain.commands.AbstractExceptionHandler - Unhandled > > exception > > java.lang.IllegalArgumentException: Path does not start with a "/" > > character > > at > > > org.apache.catalina.core.ApplicationContext.getRequestDispatcher(Applica > > tionContext.java:379) > > at > > > org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(A > > pplicationContextFacade.java:195) > > at > > > org.apache.struts.tiles.commands.TilesPreProcessor.getRequiredDispatcher > > (TilesPreProcessor.java:274) > > at > > > org.apache.struts.tiles.commands.TilesPreProcessor.doForward(TilesPrePro > > cessor.java:257) > > at > > > org.apache.struts.tiles.commands.TilesPreProcessor.execute(TilesPreProce > > ssor.java:217) > > at > > org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) > > at > > > org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.jav > > a:304) > > > > Do I need to put a JSP in the path? An empty JSP? Is there any way to > > avoid this? > > > > > > Internet communications are not secure and therefore Banco > > Santander International does not accept legal responsibility for > > the contents of this message. Any views or opinions presented are > > solely those of the author and do not necessarily represent those > > of Banco Santander International unless otherwise specifically > > stated. > > > > Las comunicaciones via Internet no son seguras y por lo tanto > > Banco Santander International no asume responsabilidad legal ni > > de ningun otro tipo por el contenido de este mensaje. Cualquier > > opinion transmitida pertenece unicamente al autor y no > > necesariamente representa la opinion del Banco Santander > > International a no ser que este expresamente detallado. > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > > For additional commands, e-mail: user-help@struts.apache.org > > > > > > > Internet communications are not secure and therefore Banco > Santander International does not accept legal responsibility for > the contents of this message. Any views or opinions presented are > solely those of the author and do not necessarily represent those > of Banco Santander International unless otherwise specifically > stated. > > Las comunicaciones via Internet no son seguras y por lo tanto > Banco Santander International no asume responsabilidad legal ni > de ningun otro tipo por el contenido de este mensaje. Cualquier > opinion transmitida pertenece unicamente al autor y no > necesariamente representa la opinion del Banco Santander > International a no ser que este expresamente detallado. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > ------=_Part_71161_26951180.1187735500100--