Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 13978 invoked from network); 4 Dec 2009 10:25:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Dec 2009 10:25:50 -0000 Received: (qmail 84001 invoked by uid 500); 4 Dec 2009 10:25:47 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 83959 invoked by uid 500); 4 Dec 2009 10:25:46 -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 83949 invoked by uid 99); 4 Dec 2009 10:25:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Dec 2009 10:25:46 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of perjoha@gmail.com designates 72.14.220.158 as permitted sender) Received: from [72.14.220.158] (HELO fg-out-1718.google.com) (72.14.220.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Dec 2009 10:25:38 +0000 Received: by fg-out-1718.google.com with SMTP id 16so920824fgg.17 for ; Fri, 04 Dec 2009 02:25:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=kXHBaa1e5ez94PiG3ya2xm8001z+4bPCO4eIwevTiG8=; b=q9c99x5d+YBDguDYduRHt8q4t0RPbMH+m/RePnm/z2B/yKAFVkiJIPS9M+ZO5hH91E MNEVFH0978LFSo2YvhpLOufrYN4wskQYvh/uEstKo73Xa8fik2aN/OO2R1jEix4rcppi XYBxfak/HQu6fucBkQcm4PbewzEcGXrE3RXC8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=R3PiVW70NoEdMhMio/LWw0nH4MZY5gQcalX/BRbtqH9F3YAtAdva4tFRMTA+toJwMG pUunrrkxp9Js9na+12bkjaBdBLcYors9Kp/6R1GCtVMcMHjPjY5bhfZnYK/tSeNuHVyi VSHLUjlVSuMKh4D8tyYaS9y3q20NEZSB2oxJ0= MIME-Version: 1.0 Received: by 10.103.78.7 with SMTP id f7mr914880mul.95.1259922318185; Fri, 04 Dec 2009 02:25:18 -0800 (PST) Date: Fri, 4 Dec 2009 11:25:18 +0100 Message-ID: <8141dfcc0912040225n2abfb1d6h435533b154d15bfa@mail.gmail.com> Subject: RequiredFieldValidator and error message from property file via key From: Per Johansson To: user@struts.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm trying to get error messages from a resource bundle. This is the code for my action class: @RequiredFieldValidator(type=ValidatorType.FIELD, key="myFieldErrorMsg", message="Error!!!!") public void setMyField(int myField) { this.myField = myField; } @Override public void validate() { if (!isMyFieldValid(myField)) { addFieldError("myField", getText("myFieldErrorMsg")); } } When validation fails for setMyField I don't get the expected error message from my resource bundle. Instead I get a struts default error message "Invalid field value for field ..." But when i call getText from the validate method, I get the expected error message. How can I get a message from a resource bundle using the annotation based validator? I'm using weblogic 10.0. /Best regards, Per Johansson --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org