Author: deepal
Date: Tue Dec 18 04:50:06 2007
New Revision: 11419

Log:

when we type wso2resgistry/ it will forwarded to  wso2resgistry/web

Modified:
   trunk/registry/modules/webapps/conf/web.xml
   
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/ControllerServlet.java

Modified: trunk/registry/modules/webapps/conf/web.xml
==============================================================================
--- trunk/registry/modules/webapps/conf/web.xml (original)
+++ trunk/registry/modules/webapps/conf/web.xml Tue Dec 18 04:50:06 2007
@@ -37,6 +37,10 @@
     </servlet-mapping>
     <servlet-mapping>
         <servlet-name>WebServlet</servlet-name>
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>WebServlet</servlet-name>
         <url-pattern>/system/*</url-pattern>
     </servlet-mapping>
     <!-- resource-ref>

Modified: 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/ControllerServlet.java
==============================================================================
--- 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/ControllerServlet.java
   (original)
+++ 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/ControllerServlet.java
   Tue Dec 18 04:50:06 2007
@@ -24,9 +24,9 @@
 import org.wso2.registry.servlet.FileUploadUtil;
 import org.wso2.registry.servlet.Utils;
 import org.wso2.registry.web.actions.*;
-import org.wso2.registry.web.utils.TagUtil;
-import org.wso2.registry.web.utils.AdminUtil;
 import org.wso2.registry.web.beans.AdminBean;
+import org.wso2.registry.web.utils.AdminUtil;
+import org.wso2.registry.web.utils.TagUtil;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
@@ -386,7 +386,11 @@
     protected void doGet(HttpServletRequest request,
                          HttpServletResponse response)
             throws ServletException, IOException {
-
+        String uri = request.getRequestURI();
+        if ("/wso2registry/".equals(uri)) {
+            request.getRequestDispatcher("/web").forward(request, response);
+            return;
+        }
         // if a path is not set in the session, set the path to the root
         String path = (String) 
request.getSession().getAttribute(UIConstants.PATH_ATTR);
         if (path == null || path.length() == 0) {
@@ -405,7 +409,6 @@
 
         initContextRoot(request);
 
-        String uri = request.getRequestURI();
 
         String controlPart = uri.substring(contextRoot.length());
         if (controlPart.startsWith(RegistryConstants.PATH_SEPARATOR + 
UIConstants.WEB_PATH)) {
@@ -451,7 +454,8 @@
 
             forwardToResources(request, response, path);
 
-        }  else if (controlPart.startsWith(RegistryConstants.PATH_SEPARATOR + 
UIConstants.SYSTEM_PATH)) {
+        } else
+        if (controlPart.startsWith(RegistryConstants.PATH_SEPARATOR + 
UIConstants.SYSTEM_PATH)) {
 
             // process system requests
 
@@ -626,7 +630,7 @@
 
                 String mediaTypes = null;
                 try {
-                    mediaTypes  = 
MediaTypesReader.getResourceMediaTypeMappings(request);
+                    mediaTypes = 
MediaTypesReader.getResourceMediaTypeMappings(request);
                 } catch (RegistryException e) {
                     mediaTypes = 
"txt:text,wsdl:wsdl/xml,xsd:xsd/xml,iml:idea/proj,ipr:idea/projs";
                 }
@@ -656,7 +660,7 @@
             if (content != null) {
                 if (content instanceof byte[]) {
                     response.setContentType("application/download");
-                    response.getOutputStream().write((byte[])content);
+                    response.getOutputStream().write((byte[]) content);
                     response.flushBuffer();
                 } else {
                     response.setContentType("application/download");

_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev

Reply via email to