activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gr...@apache.org
Subject svn commit: r405482 - /incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/AjaxServlet.java
Date Tue, 09 May 2006 17:40:13 GMT
Author: gregw
Date: Tue May  9 10:40:11 2006
New Revision: 405482

URL: http://svn.apache.org/viewcvs?rev=405482&view=rev
Log:
Allow a local resource to override js scripts

Modified:
    incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/AjaxServlet.java

Modified: incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/AjaxServlet.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/AjaxServlet.java?rev=405482&r1=405481&r2=405482&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/AjaxServlet.java
(original)
+++ incubator/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/AjaxServlet.java
Tue May  9 10:40:11 2006
@@ -17,6 +17,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -47,7 +48,17 @@
             super.doGet(request, response);
     }
     
-    protected void doJavaScript(HttpServletRequest request, HttpServletResponse response)throws
IOException {
+    protected void doJavaScript(HttpServletRequest request, HttpServletResponse response)throws
IOException, ServletException {
+        
+        // Look for a local resource first.
+        URL url = getServletContext().getResource(request.getServletPath()+request.getPathInfo());
+        if (url!=null)
+        {
+            getServletContext().getRequestDispatcher(request.getServletPath()+request.getPathInfo()).forward(request,response);
+            return;
+        }
+        
+        // Serve from the classpath resources
         String resource="org/apache/activemq/web"+request.getPathInfo();
         synchronized(jsCache){
             



Mime
View raw message