From user-return-219232-archive-asf-public=cust-asf.ponee.io@struts.apache.org Tue Jan 29 08:48:39 2019 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 0FDE4180625 for ; Tue, 29 Jan 2019 08:48:38 +0100 (CET) Received: (qmail 61436 invoked by uid 500); 29 Jan 2019 07:48:32 -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 61425 invoked by uid 99); 29 Jan 2019 07:48:32 -0000 Received: from mail-relay.apache.org (HELO mailrelay1-lw-us.apache.org) (207.244.88.152) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jan 2019 07:48:32 +0000 Received: from mail-it1-f177.google.com (mail-it1-f177.google.com [209.85.166.177]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id 5EEC5BC4 for ; Tue, 29 Jan 2019 07:48:31 +0000 (UTC) Received: by mail-it1-f177.google.com with SMTP id p197so2744899itp.0 for ; Mon, 28 Jan 2019 23:48:31 -0800 (PST) X-Gm-Message-State: AJcUukcOj7zG0tOuWlimAuilxy69aVlp+3ykpLOzUrnQ/HNw/COUL4RW WYpM2OuMMkiTB4ET9cHKEfyMzwDpQk9wZ3TdbqA= X-Google-Smtp-Source: ALg8bN7mshsxsVjbnX0o3zK8WZ10R+ycDqRMLVBlMkeapNHNT5jR4eHL18igAkJ5Zg9BpBHfMuOWqxvjqDV9eugzcgA= X-Received: by 2002:a24:d04:: with SMTP id 4mr11645740itx.19.1548748110663; Mon, 28 Jan 2019 23:48:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Lukasz Lenart Date: Tue, 29 Jan 2019 08:48:19 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: strange error when migrating to convention plugin - Struts 2.5.20 To: Struts Users Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable sob., 26 sty 2019 o 05:13 developer researcher napisa=C5=82(a): > > I am doing migration tests to convention plugin using a project generated > with the archetype "struts2-archetype-blank" > > After migrating the actions from struts.xml using the @Action annotation,= I > could observe the following: > > The line (in a JSP): " > rel=3D"stylesheet" type=3D"text/css"/> generates the following error: > > ERROR Dispatcher Could not find action or result: /blank/css/examplecss > There is no Action mapped for namespace [/css] and action name [examplecs= s] > associated with context path [/blank]. - [unknown location] > > The question is, why does struts look for an action in a reference to a c= ss > file? I'm not sure if it's a problem of "struts2-archetype-blank" or the > IDE (Eclipse JEE 2018-12). The css file does not exist but without > convention plugin (only struts.xml) this strange error does not occur. > > I solve the problem by changing the line by */css/examplecss.css*"/>" rel=3D"stylesheet" type=3D"text/css"/> and crea= ting > the css file, but still it is strange that the problem occurs only when > using the convention plugin. > > What is the reason for this difference of behavior between the actions > invocation with struts.xml and the convention plugin? Because the Plugin tries to match all the requests, it knows nothing about CSS and it tries to handle an incoming request. If you want to exclude a given request define the below constant in struts.xml https://struts.apache.org/core-developers/static-content.html Regards --=20 =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