summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-08-29 02:09:17 (EDT)
committer Stephan Born2013-09-23 05:03:00 (EDT)
commit5254e21d4acd7f380a6a7f16fb48f8451a4a561a (patch)
treeb93bcdeb56f0d546fa4412f8f40a2aa8e83990c6
parent9d4173a412e009304c2d4e1efe0f4194890ec10d (diff)
downloadorg.eclipse.stardust.ui.web-5254e21d4acd7f380a6a7f16fb48f8451a4a561a.zip
org.eclipse.stardust.ui.web-5254e21d4acd7f380a6a7f16fb48f8451a4a561a.tar.gz
org.eclipse.stardust.ui.web-5254e21d4acd7f380a6a7f16fb48f8451a4a561a.tar.bz2
Jira-ID: CRNT-29739
Added check if bean does not exist , set COMMON_MENU to blank in config.json from HTML5FrameworkServices.config() Added try/catch to RestControllerUtils.resolveSpringBean(id,context) git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/ui.web@66999 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Sidharth Singh <sidharth.singh@sungard.com>
-rw-r--r--portal-common/src/main/java/org/eclipse/stardust/ui/web/html5/rest/HTML5FrameworkServices.java5
-rw-r--r--portal-common/src/main/java/org/eclipse/stardust/ui/web/html5/rest/RestControllerUtils.java15
2 files changed, 16 insertions, 4 deletions
diff --git a/portal-common/src/main/java/org/eclipse/stardust/ui/web/html5/rest/HTML5FrameworkServices.java b/portal-common/src/main/java/org/eclipse/stardust/ui/web/html5/rest/HTML5FrameworkServices.java
index bd63536..146bc73 100644
--- a/portal-common/src/main/java/org/eclipse/stardust/ui/web/html5/rest/HTML5FrameworkServices.java
+++ b/portal-common/src/main/java/org/eclipse/stardust/ui/web/html5/rest/HTML5FrameworkServices.java
@@ -70,7 +70,10 @@ public class HTML5FrameworkServices
{
contents = StringUtils.replace(contents, "COMMON_MENU", parseCommonMenuString(commonMenuConfigStr));
}
-
+ else
+ {
+ contents = StringUtils.replace(contents, "COMMON_MENU", "");
+ }
return Response.ok(contents, MediaType.APPLICATION_JSON_TYPE).build();
}
diff --git a/portal-common/src/main/java/org/eclipse/stardust/ui/web/html5/rest/RestControllerUtils.java b/portal-common/src/main/java/org/eclipse/stardust/ui/web/html5/rest/RestControllerUtils.java
index c43626a..a97249f 100644
--- a/portal-common/src/main/java/org/eclipse/stardust/ui/web/html5/rest/RestControllerUtils.java
+++ b/portal-common/src/main/java/org/eclipse/stardust/ui/web/html5/rest/RestControllerUtils.java
@@ -2,6 +2,7 @@ package org.eclipse.stardust.ui.web.html5.rest;
import javax.servlet.ServletContext;
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
@@ -12,10 +13,18 @@ public class RestControllerUtils
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
return context.getBean(type);
}
-
+
public static Object resolveSpringBean(String beanId, ServletContext servletContext)
{
- ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
- return context.getBean(beanId);
+ try
+ {
+ ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
+ return context.getBean(beanId);
+ }
+ catch (NoSuchBeanDefinitionException ex)
+ {
+ return null;
+ }
+
}
}