Return-Path: Delivered-To: apmail-jakarta-struts-user-archive@www.apache.org Received: (qmail 84419 invoked from network); 25 Nov 2003 10:08:28 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 25 Nov 2003 10:08:28 -0000 Received: (qmail 20039 invoked by uid 500); 25 Nov 2003 10:07:46 -0000 Delivered-To: apmail-jakarta-struts-user-archive@jakarta.apache.org Received: (qmail 19893 invoked by uid 500); 25 Nov 2003 10:07:46 -0000 Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list struts-user@jakarta.apache.org Received: (qmail 19870 invoked from network); 25 Nov 2003 10:07:45 -0000 Received: from unknown (HELO d78.westmaster.com) (81.31.33.18) by daedalus.apache.org with SMTP; 25 Nov 2003 10:07:45 -0000 Received: from localhost (localhost [127.0.0.1]) by d78.westmaster.com (Postfix) with ESMTP id 6795F3D7A; Tue, 25 Nov 2003 11:07:58 +0100 (CET) Received: from offhonza (off-honza.master.cz [81.31.36.36]) by d78.westmaster.com (Postfix) with ESMTP id 739B43D77; Tue, 25 Nov 2003 11:07:57 +0100 (CET) Message-ID: <018e01c3b33b$fccad720$24241f51@offhonza> Reply-To: =?Windows-1252?Q?Honza_Spurn=FD?= From: =?Windows-1252?Q?Honza_Spurn=FD?= To: "Struts Users Mailing List" , References: <00a201c3b2a9$082cd980$24241f51@offhonza> <3FC243BF.4070502@Sun.COM> Subject: Re: MessageResources in ActionForm Date: Tue, 25 Nov 2003 11:06:19 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by AMaViS 0.3.12 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Manish Singla wrote: > Hi > > Use following > > MessageResources mr = ((MessageResources) > request.getAttribute(Globals.MESSAGES_KEY)); ^^^^^^^^ what is Globals ??? I've tried it, but my java compiler does not knows it... > > Instaed of > >> MessageResources mr = request.getMessageResources(); > > HTH > Manish Singla > > > > Honza Spurn� wrote: >> Hi there, >> >> I'm able to read values from MessageResources in JSP files. But in >> special case I need to read such values in java-classes. >> Unfortunatelly I need it in ActionForm in validate() method... >> >> To understand me I'm attaching my vision of how it could be very >> easy (it doesn't work): >> >> public ActionErrors validate(ActionMapping mapping, >> HttpServletRequest request){ >> MessageResources mr = request.getMessageResources(); >> ActionErrors errors = new ActionErrors(); >> >> if (anyReasonToFailValidation){ >> errors.add("Error found", new ActionError("key.to.this.error", >> mr.getMessage("key.to.errorMessageParameter"))); >> >> return errors; >> } >> >> I think it's clear why I need to have an object of Messageresources >> in ValidatorForm. >> >> Please, could anybody help me? >> >> Thanks a lot. >> Sporak >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: struts-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-user-help@jakarta.apache.org