From issues-return-32342-archive-asf-public=cust-asf.ponee.io@struts.apache.org Wed Sep 5 15:59:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id A2A75180672 for ; Wed, 5 Sep 2018 15:59:05 +0200 (CEST) Received: (qmail 63454 invoked by uid 500); 5 Sep 2018 13:59:02 -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 63398 invoked by uid 99); 5 Sep 2018 13:59:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2018 13:59:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2EF8B1833B1 for ; Wed, 5 Sep 2018 13:59:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id MOv6xaE10iCt for ; Wed, 5 Sep 2018 13:59:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 08DAE5F3EA for ; Wed, 5 Sep 2018 13:59:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 83886E02ED for ; Wed, 5 Sep 2018 13:59:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 44E9D26B56 for ; Wed, 5 Sep 2018 13:59:00 +0000 (UTC) Date: Wed, 5 Sep 2018 13:59:00 +0000 (UTC) From: "Konstantinos (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4957) Update struts version from 2.5.10 to 2.5.17. LocalizedTextUtil class is removed and GlobalLocalizedTextProvider&StrutsLocalizedTextProvider cannot be used instead. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4957?page=3Dcom.atlassian.ji= ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1660443= 5#comment-16604435 ]=20 Konstantinos commented on WW-4957: ---------------------------------- I removed the custom code and leave only the constant, but again the global= properties didn't load. See the Warn in my Log. *WARN=C2=A0 [http-bio-8080-exec-2] util.AbstractLocalizedTextProvider (Abst= ractLocalizedTextProvider.java:142) - Missing key [head.lbl.title] in bundl= es [[global, org/apache/struts2/struts-messages, com/opensymphony/xwork2/xw= ork-messages]]!* Although i have defined in my global.properties file=C2=A0**=C2=A0a key=C2= =A0*head.lbl.title*=C2=A0with a value and in my jsp page=C2=A0=C2=A0* ,* *the value is not loaded in my page.=C2=A0 I see the key in the page.*=C2= =A0 > Update struts version from 2.5.10 to 2.5.17. LocalizedTextUtil class is r= emoved and GlobalLocalizedTextProvider&StrutsLocalizedTextProvider cannot b= e used instead. > -------------------------------------------------------------------------= ---------------------------------------------------------------------------= --------------- > > Key: WW-4957 > URL: https://issues.apache.org/jira/browse/WW-4957 > Project: Struts 2 > Issue Type: Bug > Components: Core > Affects Versions: 2.5.17 > Reporter: Konstantinos > Assignee: Lukasz Lenart > Priority: Major > Fix For: 2.6 > > Original Estimate: 72h > Remaining Estimate: 72h > > I have an application that uses struts version 2.5.10.1. i want to update= it to version 2.5.17 after=C2=A0the announcement of the Apache Software Fo= undation that Struts 2.5 to 2.5.16 versions are vulnerable to remote attack= ers. In my current version i use a struts-core library class called Localiz= edTextUtil=C2=A0to load messages from the global message bundle. My code be= low: > {code:java} > private void initialiseMessageBundle() throws InitializationError{ > LOG.info("Loading global messages from " + DEFAULT_RESOURCE); > URL[] urls; > try { > String resourceFolder =3D PropertiesManager.get(Constants.PROP_RE= SOURCES_FOLDER); > File file =3D new File(resourceFolder); > if (!file.exists() || !file.isDirectory()){ > LOG.error("file not found: path(" + Constants.PROP_RESOURCES_= FOLDER + ") =3D " + resourceFolder); > throw new InitializationError("External resource not found fi= le not found"); > } else { > LOG.debug("resources file: " + file.toURI().toURL()); > } > URL url =3D file.toURI().toURL(); > urls =3D new URL[]{url}; > ClassLoader cl =3D new URLClassLoader(urls); > LocalizedTextUtil.setDelegatedClassLoader(cl); > LocalizedTextUtil.addDefaultResourceBundle("global"); > } catch (MalformedURLException e) { > throw new InitializationError("MalformedURLException occured duri= ng the messageBundle initialisation", e); > } > LOG.info("Global messages loaded."); > } > {code} > =C2=A0 > After updating the struts version to 2.5.17 the *LocalizedTextUtil* class= is removed. Although i create a new instance of class *GlobalLocalizedText= Provider* and *StrutsLocalizedTextProvider* and used the same methods (*set= DelegatedClassLoader*,*addDefaultResourceBundle*) my messages=C2=A0are not = been=C2=A0loaded. Also i create a bean of these classes on struts.xml and t= ried to inject it but again without success. Do you have any thought how ca= n i replace the LocalizedTextUtil in my code above? > Thank you. > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)