Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9B86518C03 for ; Sun, 6 Mar 2016 21:12:43 +0000 (UTC) Received: (qmail 22338 invoked by uid 500); 6 Mar 2016 21:12:38 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 22263 invoked by uid 500); 6 Mar 2016 21:12:38 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 22251 invoked by uid 99); 6 Mar 2016 21:12:37 -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; Sun, 06 Mar 2016 21:12:37 +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 547EBC0679 for ; Sun, 6 Mar 2016 21:12:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.821 X-Spam-Level: X-Spam-Status: No, score=-0.821 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id U5ZA8kOduw_z for ; Sun, 6 Mar 2016 21:12:36 +0000 (UTC) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 06FC65F2C3 for ; Sun, 6 Mar 2016 21:12:35 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id l68so84926858wml.0 for ; Sun, 06 Mar 2016 13:12:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=YabmRnVYn5dKsRALX4y9SlJoaS0cQyv71ko1hqocB80=; b=Z4YCmnh5KItemScAF/KkuOjHBDSc7+MFsLdjBXR9Ywd6tvuTgjbBZX3ftsaqpOvyFj SAMtl69WCpXCh8kPFadSr1J18Fdk02uHeMKg+vFeqUskaJ10xGO4U2K3AMVj37M50bI7 SO7pbumJQy7plUYbET0Gdyom+DkPvjx1NtL2g8ygMzpVSDRco9Zln2TkdLdJqdEJUg9u jUMkP++fRwJ6X0E44f4SErUa64PwmBchOP3AIR1bjNg9JFk6GGmSpKWjrS392Ajjs2fB ml95pU899fzQ8bz27DOtO/+EjvwE79CzcVzEWeB0/2lJXSVmXuVHIsSNTsbJHJ9Fhiaz /EgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=YabmRnVYn5dKsRALX4y9SlJoaS0cQyv71ko1hqocB80=; b=Pjz0IF9l5sXrgLTWqQo8vyM+bwi+/mKuPjGAXQJHVlg1qQx6fYPoIBggRPOq0CSkl2 M1Zj7aW8C5dQXF6uzaFBuoqwm4JBd/t68g+4BWn/tXdEPlf5FS2Wb8pLDFewnRIct9Pa oOQMtfp6XfYrrLZiiJrtRW/BeFH9ytvh7yqzKwHDI5QcVFPl3sxpGHm4ZqZvz6m3fSre UEAiPPm5fS0kcXxR8ObxlfntqkDQWElAx6rDDPsIU3Fl8xmLGAXo2xkhTYHwGEpn5HKs 0alaR8ekVWQIMqy74eq0Gcvgusvdfqql/lDtEiYCICf8paBch617KFp3aYTikd8cFt9Z tCUQ== X-Gm-Message-State: AD7BkJJikcOjnkAVkn/wvTeoXldOLl+L1ge9OrQI10ewoCJx9pUZ3XFprQJ1TLoo5y7B/Q== X-Received: by 10.28.55.139 with SMTP id e133mr9428010wma.98.1457298754822; Sun, 06 Mar 2016 13:12:34 -0800 (PST) Received: from [192.168.2.7] ([5.179.71.142]) by smtp.googlemail.com with ESMTPSA id m6sm14660463wje.21.2016.03.06.13.12.33 for (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Mar 2016 13:12:33 -0800 (PST) Subject: Re: How CXF helps to redirect to non-matching http request to a static HTML page To: users@cxf.apache.org References: From: Sergey Beryozkin Message-ID: <56DC9D31.7080409@gmail.com> Date: Sun, 6 Mar 2016 21:12:17 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi If CXFServlet has a wildcard pattern then another idea might be to catch 404 with ExceptionMapper and then redirect with the help of RequestDispatcherProvider (ex, the mapper returns Error bean in Response and the provider is configured to map Error to error.html) - in this case CXFServlet will need to be additionally configured to redirect requests to say error.html to a 'default' servlet. Sergey On 05/03/16 17:15, Jose MarĂ­a Zaragoza wrote: > Hi > > You could use a custom error page for 404 error code > Look at error-page and error code in web.xml > > > 2016-03-05 6:23 GMT+01:00 Sumit Arora : >> As CXF provides configuration to set default page from : >> >> >> static-welcome-file >> /main.html >> >> >> This is working fine. >> >> My question : *How to redirect to non-matching http request to a static >> HTML page ?* >> >> 'Sumit -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/