geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lin...@apache.org
Subject svn commit: r701418 - /geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java
Date Fri, 03 Oct 2008 15:55:13 GMT
Author: linsun
Date: Fri Oct  3 08:55:13 2008
New Revision: 701418

URL: http://svn.apache.org/viewvc?rev=701418&view=rev
Log:
add some instruction on how to access this servlet from browser

Modified:
    geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java

Modified: geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java?rev=701418&r1=701417&r2=701418&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java
(original)
+++ geronimo/server/trunk/plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/car/GeronimoAsMavenServlet.java
Fri Oct  3 08:55:13 2008
@@ -110,12 +110,17 @@
                         buf.append(part);
                     }
                     generateMavenFile(kernel, response.getWriter(), buf.toString(), parts[parts.length-1],
reply);
-                } else {
+                } else if (parts.length == 2) {
                     generateMavenFile(kernel, response.getWriter(), parts[0], parts[1], reply);
+                } else {
+                    generateInstruction(path, response);
                 }
             } catch (Exception e) {
                 throw new ServletException("Unable to generate Geronimo configuration list",
e);
             }
+        } else if (path.equals("/")) {
+            //give user some basic instructions
+            generateInstruction(path, response);
         } else {
             if(path.startsWith("/")) {
                 path = path.substring(1);
@@ -254,5 +259,14 @@
         Text node = doc.createTextNode(text);
         child.appendChild(node);
     }
-
+    
+    private void generateInstruction(String path, HttpServletResponse response) throws IOException
{
+        response.setContentType("text/html");
+        PrintWriter out = response.getWriter();
+        out.println("Hello, this is the GeronimoAsMavenServlet.   The path - " + path + "
you entered is not recognized.   <br/>");
+        out.println("Please enter a valid path, for example: <br/>");
+        out.println("/geronimo-plugins.xml <br/>");
+        out.println("/org/apache/geronimo/maven-metadata.xml <br/>");
+        out.close();
+    }
 }



Mime
View raw message