Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3DEA3200D34 for ; Fri, 3 Nov 2017 13:38:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3C7EE160BFB; Fri, 3 Nov 2017 12:38:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6364E160BE9 for ; Fri, 3 Nov 2017 13:38:13 +0100 (CET) Received: (qmail 84452 invoked by uid 500); 3 Nov 2017 12:38: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 84440 invoked by uid 99); 3 Nov 2017 12:38:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Nov 2017 12:38:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 05DBBDE119 for ; Fri, 3 Nov 2017 12:38:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.879 X-Spam-Level: ** X-Spam-Status: No, score=2.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id F0hFvLdq4Aba for ; Fri, 3 Nov 2017 12:38:09 +0000 (UTC) Received: from mail-ot0-f179.google.com (mail-ot0-f179.google.com [74.125.82.179]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id E76325FC8A for ; Fri, 3 Nov 2017 12:38:08 +0000 (UTC) Received: by mail-ot0-f179.google.com with SMTP id c47so2294828otj.6 for ; Fri, 03 Nov 2017 05:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=vLedbaL5UFEf8jOcOCv16qsy3VxMxP/NmltcaAhMTWI=; b=ve/jRkVPS7EWn1gSgHWDyGFcFy/lYcK5mn/ZkCn4xps9R3XyCcDhY7PaA9aOw45ycM nVsc7zQWV/155u5jix2m+t9a85cuEIjZvJRpFaCpYE33O0RjixzJKemw9gf/AVb0VdKD enmFiO06GEMnZS5ThifUNPkVGnOgLbXnxjqbO7cgX+Bp0W0NJlVmp7w2JJfIEfIy1wed HWpn1vldeyBU8ttNs+eCTojmzZJc0Ti8OuHG06FQaoukXt+KDrjt487eSStE39AZpVrE MtY4EVID749qEX6wPWHEM7ywc3Iil5tyyhBdEby17DeLpihWIFIA3UJHIHRqTIN+36oJ WRBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=vLedbaL5UFEf8jOcOCv16qsy3VxMxP/NmltcaAhMTWI=; b=hNF7wneelXgbM7fkz4Q35yQ7yVj8kemL9YYqzwdXJvaNtXcaKyba1Uf2ab7lyxOeRl CChT9XuWLKgqXG5YAJXeVuxsUURaXMOnlATUdxYHWcOJ/ithNtQp8mc3qMuo1kAvRIoR h72XHlaXxiCY0e78EvpSdFc+rdRe82G6cOfHjEjb8K+We0iEf25YSo+BP7gWCHBkKet+ KV1BMiO5eel6wA1u6gTzHXm3RWwaXErUHH2zA/Bp+XV2LjUojoy6kVo2rYxz22rpkWUA /HNJSVQT+Qs3+KPpQogK1RZqKau0Yd4bS4Xd89Q4BIxOHQ89XA+DgPWZVNkB7DD2Gh4U tCYA== X-Gm-Message-State: AJaThX5OXZgImBpT9Nk3EM+cwkKtlPWwsRmyIGZh3FUavZ9mu43XZYgK dBTNGMcf0nld0HQbYJ4GVMTvfdpcfh0Jx7ZyX7+XqQ== X-Google-Smtp-Source: ABhQp+QGUNkQpUiF8xq8uGGJwnHGL46HRlLEXpsJN8LV5vln65LAxjewsOG8M87unkS7l6/cb1tuE//+zDbDMSNGUug= X-Received: by 10.157.53.77 with SMTP id l13mr4095488ote.403.1509712687074; Fri, 03 Nov 2017 05:38:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.84.130 with HTTP; Fri, 3 Nov 2017 05:38:05 -0700 (PDT) In-Reply-To: References: From: Ej Magdaluyo Date: Fri, 3 Nov 2017 20:38:05 +0800 Message-ID: Subject: Re: Upgrading Struts 2.2.3 to 2.3.34 To: Struts Users Mailing List Content-Type: multipart/alternative; boundary="001a11c020f86d1126055d136089" archived-at: Fri, 03 Nov 2017 12:38:14 -0000 --001a11c020f86d1126055d136089 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Lukasz, Yasser, Sorry for the late reply. Yes, the tiles jsp jar is on the classpath. After weeks of facing this issue, one of my colleagues was able to solve the issue. We imported the following in the java file: import org.apache.struts2.dispatcher.*; and added the following in the viewMyRequest method: RequestMap rm =3D (RequestMap)ActionContext.getContext().get("request"); rm.put("REQ", ViewReqDetails); Then in the jsp, we changed the way values were being called: ex: <% ViewReqDetailsVO ViewReqDetails =3D (ViewReqDetailsVO)request.getAttribute("ViewReqDetails"); java.util.List classficationList =3D ViewReqDetails.getClassficationList(); This seemed to do the trick and we are now able to fetch all the values correctly. Thank you Yasser and Lukasz for all your help. This would not have been possible without your assistance. Regards, EJ Magdaluyo On Fri, Nov 3, 2017 at 8:05 PM, Lukasz Lenart wrote: > Do you have the Tiles JSP jar on the classpath? > > https://tiles.apache.org/framework/tiles-jsp/index.html > > > Regards > -- > =C5=81ukasz > + 48 606 323 122 http://www.lenart.org.pl/ > > 2017-10-30 16:36 GMT+01:00 Ej Magdaluyo : > > Hi Lukasz, > > > > Unfortunately, the coding conventions in our application are not up to > > today's standards. We were given this old application to work on hence > some > > of the conventions (such as scriplets) are not ideal. > > > > This is the supposed flow: > > > > struts.xml: > > > > > class=3D"com.MyRequestAction"> > > /jsp/viewMyRequest.jsp > > > > > > > > method viewMyRequest (we had tested the java file itself, and the reque= st > > is setting corerctly): > > > > public String viewMyRequest() throws Exception { > > SearchCriteriaVO searchCriteriaVO=3D constructSearchCriteria(); > > MyRequestDelegate myRequestDelegate =3D new MyRequestDelegate(); > > ViewReqDetails =3D myRequestDelegate.getRequestViewDetails( > searchCriteriaVO); > > ViewReqDetails.setEditApprover(false); > > String searchEnabled=3Drequest.getParameter("searchEnabled"); > > if(searchEnabled!=3Dnull&&searchEnabled.equalsIgnoreCase("true")){ > > ViewReqDetails.setSearchEnabled(true); > > } > > setViewReqDetails(ViewReqDetails); > > request.setAttribute("ViewReqDetails", ViewReqDetails); > > return SUCCESS; > > } > > > > > > SUCCESS here should mean that the result will ensure that page will get > > routed to /jsp/viewMyRequest.jsp. > > > > Problem now is that even though ViewReqDetails attribute was set, the > value > > is not transferring over once we try to retrieve this value in the jsp > file: > > > > viewMyRequest.jsp: > > > > ViewReqDetailsVO ViewReqDetails =3D > > (ViewReqDetailsVO)request.getAttribute("ViewReqDetails"); > > java.util.List classficationList =3D ViewReqDetails. > getClassficationList(); > > > > A null value is being returned here, which is most likely why we get 40= 3 > > forbidden also. > > > > I am not sure where in struts/tiles update caused the passing of reques= t > > attributes to change though, but I am guessing that is what caused this= . > > > > Thanks! > > > > > > On Fri, Oct 27, 2017 at 9:47 PM, Lukasz Lenart > > wrote: > > > >> 2017-10-27 14:34 GMT+02:00 Ej Magdaluyo : > >> > This is the java code: > >> > public String viewMyRequest() throws Exception { > >> > SearchCriteriaVO searchCriteriaVO=3D constructSearchCriteria(); > >> > MyRequestDelegate myRequestDelegate =3D new MyRequestDelegate(); > >> > ViewReqDetails =3D myRequestDelegate.getRequestViewDetails( > >> searchCriteriaVO); > >> > ViewReqDetails.setEditApprover(false); > >> > String searchEnabled=3Drequest.getParameter("searchEnabled"); > >> > if(searchEnabled!=3Dnull&&searchEnabled.equalsIgnoreCase("true")){ > >> > ViewReqDetails.setSearchEnabled(true); > >> > } > >> > setViewReqDetails(ViewReqDetails); > >> > request.setAttribute("ViewReqDetails", ViewReqDetails); > >> > return SUCCESS; > >> > } > >> > > >> > > >> > If we try to run tests within this java file, we are able to get the > >> values > >> > without any issues. It is just when we try to call this attribute > where > >> the > >> > problem begins. > >> > >> Now I'm confused ... you have this code in your action but still > >> transferring it over request to a scriplet? > >> > >> How defintion of SUCCESS result looks like? > >> > >> > >> Regards > >> -- > >> =C5=81ukasz > >> + 48 606 323 122 http://www.lenart.org.pl/ > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > >> For additional commands, e-mail: user-help@struts.apache.org > >> > >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > --001a11c020f86d1126055d136089--