Return-Path: X-Original-To: apmail-struts-user-archive@www.apache.org Delivered-To: apmail-struts-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0BA01F1D9 for ; Tue, 26 Mar 2013 17:43:15 +0000 (UTC) Received: (qmail 83230 invoked by uid 500); 26 Mar 2013 17:43:12 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 83184 invoked by uid 500); 26 Mar 2013 17:43:12 -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 83175 invoked by uid 99); 26 Mar 2013 17:43:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Mar 2013 17:43:12 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aparcos@gmail.com designates 209.85.223.177 as permitted sender) Received: from [209.85.223.177] (HELO mail-ie0-f177.google.com) (209.85.223.177) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Mar 2013 17:43:08 +0000 Received: by mail-ie0-f177.google.com with SMTP id tp5so4831876ieb.22 for ; Tue, 26 Mar 2013 10:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=1DImbavUTaclMg5JBC/9FRqcaVLdtN7xLVgbHSNW7rg=; b=NpsqOICqYQoyenNRxsXQSRhBR/8Q4QwN2dATouexgZjMGy073nbAOlL10hEWSJme2K LzE6Yrf6reWi4K4Ao0+B4+DoY1eLbri/mopc3fn/zGhV9/ECoZyOjvXDnd8+rXmjMheb tvRFcmE+ZqF61OvQvU+hlaz/ZGtNCMycjUskKXu62O/d4hX5RY87QT6cb/19fLi+3+O2 WSTQSF/6SYJgKF/C2cVGMGzdY726vzVIunQN1/48obUjcvzXBlKnr9jW0lja6TTRpnsv 20VD2/DFmvLL/F6wgcJyWH6y0j3xx6M9pi6CSRPLFblGLVwjnwxY0tSBFwdsHdDRRNc+ w/Jg== MIME-Version: 1.0 X-Received: by 10.50.17.234 with SMTP id r10mr1839040igd.102.1364319767911; Tue, 26 Mar 2013 10:42:47 -0700 (PDT) Received: by 10.64.25.226 with HTTP; Tue, 26 Mar 2013 10:42:47 -0700 (PDT) In-Reply-To: References: Date: Tue, 26 Mar 2013 18:42:47 +0100 Message-ID: Subject: Re: struts2 (2.2.1) adds field error and doesn't return input!! From: Alejandro To: Struts Users Mailing List Content-Type: multipart/alternative; boundary=14dae9340ff520776f04d8d7737c X-Virus-Checked: Checked by ClamAV on apache.org --14dae9340ff520776f04d8d7737c Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Again, you don't put validate to true in the form If there are errors why does the action return success ?? 2013/3/26 Alejandro > false;"/> > > The second return never will return false because the first return false > always. > > > 2013/3/26 lucas owen > >> I have this wierd problem when validating an action, I add field errors = in >> the validate method but Struts2 doesn=B4t return input and continues >> execution. I show you my configuration (only relevant points): >> >> .jsp >> ------ >> >> >> >> >> >> >> > false;"/> >> >> >> struts.xml >> --------------- >> >> > "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" >> "http://struts.apache.org/dtds/struts-2.1.dtd"> >> >> >> >> >> >> >> >> > struts-default"> >> >> > class=3D"org.apache.struts2.views.tiles.TilesResult" default=3D"true" /> >> > class=3D"org.apache.struts2.views.jasperreports.JasperReportsResult"/> >> >> >> >> > name=3D"location">/WEB-INF/pages/person/person.jsp >> >> >> personSuccess >> ${person.id} >> ${selectedId} >> >> >> >> >> >> >> Action >> --------- >> >> public class PersonAction extends ActionSupport { >> >> Person person; >> PersonService personService; >> public void validateSave() { >> if(person.getSurname().equals("")){ >> addFieldError("person.surname", getText("mandatory",new >> String[]{"Surname"})); >> } >> if(person.getName().equals("")){ >> addFieldError("person.name", getText("mandatory",new String[]{"Name"})); >> } >> } >> public String save() { >> try { >> personService.save(person); >> addActionMessage(getText("response.save_ok")); >> } catch (Exception e) { >> ErrorHandler.add(this, e, log); >> } >> return "success"; >> } >> } >> >> if in the validate i add action errors instead of field errors everythin= g >> works correctly... >> >> Any help would be so much appreciated >> THANKS IN ADVANCE!!! >> > > --14dae9340ff520776f04d8d7737c--