Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 376F418A59 for ; Thu, 10 Mar 2016 07:47:46 +0000 (UTC) Received: (qmail 93703 invoked by uid 500); 10 Mar 2016 07:47:41 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 93667 invoked by uid 500); 10 Mar 2016 07:47:41 -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 93604 invoked by uid 99); 10 Mar 2016 07:47:41 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Mar 2016 07:47:41 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B86EE2C1F54 for ; Thu, 10 Mar 2016 07:47:40 +0000 (UTC) Date: Thu, 10 Mar 2016 07:47:40 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4533) 404 error with @Action("/") when upgrading Struts2 REST 2.1.8 to 2.3.24 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-4533?page=3Dcom.atlassian.ji= ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1518885= 9#comment-15188859 ]=20 ASF subversion and git services commented on WW-4533: ----------------------------------------------------- Commit 3c68a3def6f85570ee5a931f82e5d53f442f0928 in struts's branch refs/hea= ds/master from [~lukaszlenart] [ https://git-wip-us.apache.org/repos/asf?p=3Dstruts.git;h=3D3c68a3d ] WW-4533 Reverts the old behaviour of how empty action should be handled > 404 error with @Action("/") when upgrading Struts2 REST 2.1.8 to 2.3.24 > ----------------------------------------------------------------------- > > Key: WW-4533 > URL: https://issues.apache.org/jira/browse/WW-4533 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST > Affects Versions: 2.3.7, 2.3.8, 2.3.12, 2.3.14, 2.3.14.1, 2.3.14.2, 2.= 3.14.3, 2.3.15, 2.3.15.1, 2.3.15.2, 2.3.15.3, 2.3.16, 2.3.16.1, 2.3.16.2, 2= .3.16.3, 2.3.20, 2.3.24 > Environment: *ix System, Tomcat 6.0.44, Java 1.6 > Reporter: Julio Aragao > Labels: Mapping, Plugin, REST, URL > Fix For: 2.3.25 > > > I have a web app made using Struts 2 version 2.1.8, and its Convention an= d REST plugins. I needed to update it to the latest version (2.3.24) but on= e feature I used to have stopped working. I tracked the versions after 2.1.= 8, and found out that it was after version 2.3.7 that the problem started t= o happen. I have created a simple app called =E2=80=9Cupgradetest" to isola= te the problem. Here is the error scenario: > I have an Action called HomeController, in which I have a method index() = that is marked with the @Action(=E2=80=9C/=E2=80=9C) annotation, so that th= e root url of the app maps to this method, like below: > {code:java} > package upgradetest.web.struts; > import org.apache.struts2.convention.annotation.Action; > import org.apache.struts2.rest.RestActionSupport; > import upgradetest.model.Messages; > public class HomeController extends RestActionSupport { > private Messages messages; > public HomeController() { > } > @Action("/") > public String index() { > messages =3D new Messages(); > return show(); > } > public String show() { > return "show"; > } > public Messages getMessages() { > return messages; > } > } > {code} > Here is my struts.xml file: > {code:xml} > > "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" > "http://struts.apache.org/dtds/struts-2.3.dtd"> > > > > > > > > > > > > {code} > Normally, by visiting the root url of my app (=E2=80=9C/=E2=80=9C) in Str= uts2 2.1.8, the index() method was called, and it then took the user to the= desired result. After the upgrade to 2.3.7, the web app is returning a 404= error. I have investigated the source code and found out that the RestAct= ionMapper of Struts Rest Plugin is returning null in the getMapping method = (in the last line of code), something it did not in version 2.1.8. I believ= e this change was done for some reason so I was wondering: > Is there a way to map the root url (=E2=80=9C/=E2=80=9C) to a specific ac= tion of mine without having to do a redirect or something like that (becaus= e of a SEO requirement I have)? Also, am I doing it the wrong way? -- This message was sent by Atlassian JIRA (v6.3.4#6332)