Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 25B2E10131 for ; Wed, 26 Mar 2014 02:21:25 +0000 (UTC) Received: (qmail 76534 invoked by uid 500); 26 Mar 2014 02:21:17 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 76407 invoked by uid 500); 26 Mar 2014 02:21:15 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 76383 invoked by uid 99); 26 Mar 2014 02:21:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Mar 2014 02:21:15 +0000 Date: Wed, 26 Mar 2014 02:21:15 +0000 (UTC) From: "Jose L Martinez-Avial (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4311) HttpHeaderResult should allow to provide a body for the response MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13947468#comment-13947468 ] Jose L Martinez-Avial commented on WW-4311: ------------------------------------------- Actually, taking a look at the code. I think we also need to change the status to be an String,instead of an int, and make it parseable. This way it would behave the same way as the error/errorMessage fields. The main difference I see is that there is a constructor HttpHeaderResult(int status), and it would be impacted. Is that constructor used somewhere? > HttpHeaderResult should allow to provide a body for the response > ---------------------------------------------------------------- > > Key: WW-4311 > URL: https://issues.apache.org/jira/browse/WW-4311 > Project: Struts 2 > Issue Type: Improvement > Components: Dispatch Filter > Reporter: Jose L Martinez-Avial > Priority: Minor > > Curently the HttpHeaderResult can only write to the body response if it is the result has a parameter error (through the errorMessage setter), and then it uses javax.servlet.http.HttpServletResponse#sendError(int, String) to send the error, with the error message in the body, to the client. > If the result has a parameters status, and no error, then nothing is written to the response body. It only set the status and the headers, and send it to the client. > I suggest to add a parameter message that can be written to the response when using the parameter status. > I'm working on a patch for this, it shouldn't take long. -- This message was sent by Atlassian JIRA (v6.2#6252)