Author: hoang_to
Date: 2011-01-20 03:35:09 -0500 (Thu, 20 Jan 2011)
New Revision: 5796
Modified:
portal/branches/branch-GTNPORTAL-1745/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInGuiceServletContextListener.java
Log:
GNTPORTAL-1712: Make sure the path to container.js begins a leading slash as mentioned in
javadoc of ServletContext. Some application servers such as JBoss, WebSphere requires this
leading slash
Modified:
portal/branches/branch-GTNPORTAL-1745/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInGuiceServletContextListener.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1745/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInGuiceServletContextListener.java 2011-01-20
03:34:15 UTC (rev 5795)
+++
portal/branches/branch-GTNPORTAL-1745/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInGuiceServletContextListener.java 2011-01-20
08:35:09 UTC (rev 5796)
@@ -32,6 +32,14 @@
@Override
public String loadContentAsString(String path, String encoding) throws
IOException{
+ //To make sure that the path begins with a slash, as required in the javadoc of
method
+ // getResourceAsStream in ServletContext
+ //The leading slash is required on certain application servers such as JBoss,
WebSphere
+ if('/' != path.charAt(0))
+ {
+ path = '/' + path;
+ }
+
InputStream is = scontext.getResourceAsStream(path);
if(is == null)
Show replies by date