Return-Path: X-Original-To: apmail-myfaces-users-archive@www.apache.org Delivered-To: apmail-myfaces-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 700CF106D6 for ; Sun, 7 Jul 2013 11:29:06 +0000 (UTC) Received: (qmail 10254 invoked by uid 500); 7 Jul 2013 11:29:05 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 10208 invoked by uid 500); 7 Jul 2013 11:29:00 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 10145 invoked by uid 99); 7 Jul 2013 11:28:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Jul 2013 11:28:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of vedmack@gmail.com designates 209.85.217.174 as permitted sender) Received: from [209.85.217.174] (HELO mail-lb0-f174.google.com) (209.85.217.174) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Jul 2013 11:28:51 +0000 Received: by mail-lb0-f174.google.com with SMTP id x10so3048469lbi.33 for ; Sun, 07 Jul 2013 04:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=qjjxCgP7n8feYoISzDNNt1J/+u0HjR3sRNnHf3s73Jo=; b=rLEyDzrnFWqO5xdnMKm1fLWZQ9gEgwj1DKyfe8NGr0jWmABCeBKN0pY7iYG1YsG8Az nXfYYs/pLsLgLuKHHbPPYB/jLaZJ7Zhgz6y5JlofLo+vpdnWWaIU52DwXnoDZ34pPUTI KfrJlwWt500Z9Q4PNAu0Nxwg0aR7CyyIjoykoJCIEH6s7gLE7tfSnQmLHra1JcFMBr+q mBXAsQXjKMeaYzDAcTrZlEaG76tuNmtG+brwLFi/uCL26f5kmesgVTvis7sPsZt9fwUf s+0GKE4BjO2Ys7EiMZYepp9mubvN4nb5guoJ+vo9Ru/ol602ifm20SF+Jdy4FRI8hmzw SAeg== MIME-Version: 1.0 X-Received: by 10.112.189.101 with SMTP id gh5mr8680184lbc.73.1373196510240; Sun, 07 Jul 2013 04:28:30 -0700 (PDT) Received: by 10.114.7.102 with HTTP; Sun, 7 Jul 2013 04:28:30 -0700 (PDT) Date: Sun, 7 Jul 2013 14:28:30 +0300 Message-ID: Subject: Custom is being ignored (only for certain paths) From: Daniel Reznick To: MyFaces Discussion Content-Type: multipart/alternative; boundary=001a11c3738a3324d704e0ea3a54 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3738a3324d704e0ea3a54 Content-Type: text/plain; charset=ISO-8859-1 For some reason my 404 /error/error.html which is defined in tomcat\conf\web.xml is being ignored when I'm trying to access the following path WebAppName/javax.faces.resource/anyFileName.jsf I know that its cause of the *javax.faces.resource* prefix and the *.jsf* suffix combined together... cause if I change one of them I do get the custom error page I do know that its not a common path to pick, but still I wonder how can I make it use my custom error-page b.t.w , I'm using *myfaces 2.0.11* I found one way to overcome it by using implementing custom filter and setting response.sendError(404.... but Its not a good solution IMO , cause I need to use "new File" each time to check for existence and add some logic for converting the .jsf to xhtml or omitting .jsf before checking the ".exists()" for the file this is a code snippet: String path = ((HttpServletRequest) req).getServletPath(); if (((HttpServletRequest) req).getRequestURI().contains("javax.faces.resource") && !new File(getFilterConfig().getServletContext().getRealPath(path)).exists()) { HttpServletResponse response = (HttpServletResponse) res; response.sendError(404, "Cannot find " + path); } else { chain.doFilter(req, res); } Is there any other better way to use the Custom for path of the type "WebAppName/javax.faces.resource/anyFileName.jsf" Regards, Daniel. --001a11c3738a3324d704e0ea3a54--