Fixed FELIX-2274 /404 when plugin is missing/
https://issues.apache.org/jira/browse/FELIX-2274

includes English and Bulgarian localization

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@933933 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
index ffdc188..0daf99d 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
@@ -386,7 +386,15 @@
         }
         else
         {
-            response.sendError( HttpServletResponse.SC_NOT_FOUND );
+            final String body404 = MessageFormat.format(
+                resourceBundleManager.getResourceBundle(bundleContext.getBundle(), locale).getString(
+                    "404"), new Object[] {
+                    request.getContextPath() + request.getServletPath() + '/' + BundlesServlet.NAME
+                });
+            response.setCharacterEncoding( "utf-8" );
+            response.setContentType( "text/html" );
+            response.setStatus( HttpServletResponse.SC_NOT_FOUND );
+            response.getWriter().println( body404 );
         }
     }
 
diff --git a/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties b/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties
index d43d617..c5d2893 100644
--- a/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties
+++ b/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties
@@ -236,3 +236,12 @@
 configStatus.pluginTitle=Конфиг. статус
 configStatus.wait=Моля изчакайте...
 configStatus.wait.msg=Зареждане...
+
+# 404 plugin not found
+404=\
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="refresh" content="3;URL={0}" />\
+<title>404 Not Found</title>\
+</head><body>\
+<p>Страницата, която търсите (вече) липсва. След 3 секунди ще бъдете препратени автоматично към Уеб конзолата. Ако това не се случи, моля кликнете <a href="{0}">тук</a></p>\
+</body></html>
diff --git a/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties b/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
index d91f369..aaa348e 100644
--- a/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
+++ b/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
@@ -236,3 +236,11 @@
 configStatus.wait=Please wait...
 configStatus.wait.msg=Loading...
 
+# 404 plugin not found
+404=\
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="refresh" content="3;URL={0}" />\
+<title>404 Not Found</title>\
+</head><body>\
+<p>The requested page was not found. If you are not forwarded in 3 seconds to the Web Console, please click <a href="{0}">here</a></p>\
+</body></html>