Author: vvalchev
Date: Wed Apr 14 12:45:21 2010
New Revision: 933933
URL: http://svn.apache.org/viewvc?rev=933933&view=rev
Log:
Fixed FELIX-2274 /404 when plugin is missing/
https://issues.apache.org/jira/browse/FELIX-2274
includes English and Bulgarian localization
Modified:
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
felix/trunk/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties
felix/trunk/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
Modified:
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
URL:
http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java?rev=933933&r1=933932&r2=933933&view=diff
==============================================================================
---
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
(original)
+++
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java
Wed Apr 14 12:45:21 2010
@@ -386,7 +386,15 @@ public class OsgiManager extends Generic
}
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 );
}
}
Modified:
felix/trunk/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties
URL:
http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties?rev=933933&r1=933932&r2=933933&view=diff
==============================================================================
---
felix/trunk/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties
[UTF-8] (original)
+++
felix/trunk/webconsole/src/main/native2ascii/OSGI-INF/l10n/bundle_bg.properties
[UTF-8] Wed Apr 14 12:45:21 2010
@@ -236,3 +236,12 @@ obr.res.installedVer=Инсталира�
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>
Modified:
felix/trunk/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
URL:
http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties?rev=933933&r1=933932&r2=933933&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
(original)
+++ felix/trunk/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
Wed Apr 14 12:45:21 2010
@@ -236,3 +236,11 @@ configStatus.pluginTitle=Configuration S
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>