From issues-return-32382-archive-asf-public=cust-asf.ponee.io@struts.apache.org Tue Sep 11 10:07: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 E5A3518065B for ; Tue, 11 Sep 2018 10:07:05 +0200 (CEST) Received: (qmail 13851 invoked by uid 500); 11 Sep 2018 08:07:04 -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 13584 invoked by uid 99); 11 Sep 2018 08:07:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2018 08:07:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 6EAA8C045F for ; Tue, 11 Sep 2018 08:07:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-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-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id N9JHJaiWbYiB for ; Tue, 11 Sep 2018 08:07:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 9F0DE5F501 for ; Tue, 11 Sep 2018 08:07:02 +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 B1067E0360 for ; Tue, 11 Sep 2018 08:07:01 +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 8E5C626B5E for ; Tue, 11 Sep 2018 08:07:00 +0000 (UTC) Date: Tue, 11 Sep 2018 08:07:00 +0000 (UTC) From: "Lukasz Lenart (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=3D1661024= 1#comment-16610241 ]=20 Lukasz Lenart commented on WW-4957: ----------------------------------- Great! > 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)