Index: gs3-extensions/mat/trunk/src/org/greenstone/mat/servlet/MatServlet.java
===================================================================
--- gs3-extensions/mat/trunk/src/org/greenstone/mat/servlet/MatServlet.java	(revision 21968)
+++ gs3-extensions/mat/trunk/src/org/greenstone/mat/servlet/MatServlet.java	(revision 21972)
@@ -58,5 +58,5 @@
 	out.println(h1String);
 	out.println("<p>"+description+"</p>");
-	out.println("<div><form method=\"post\" action=\"http://"+hostName+":"+port_number+"/greenstone3/mat\">");
+	out.println("<div><form method=\"post\" action=\"http://"+hostName+":"+port_number+"/mat/analyse\">");
 
 	out.println("<p>OAI URL: <input type=\"text\" name=\"oaiurl\" size=\"140\"></p>"); 
@@ -318,5 +318,5 @@
 		    
 		    out.println("<p>Choose one metadata prefix to use:</p>");
-		    out.println("<form method=\"post\" action=\"http://"+hostName+":"+port_number+"/greenstone3/mat\">");
+		    out.println("<form method=\"post\" action=\"http://"+hostName+":"+port_number+"/mat/analyse\">");
 		    out.println("<table rules =\"none\">");
 		    
@@ -426,5 +426,5 @@
 	out.println("<p>Building collection...</p>");
 	
-	String host = "http://"+hostName+":"+port_number+"/greenstone3/mat/";
+	String host = "http://"+hostName+":"+port_number+"/mat/";
 	
 	out.println("<form method=\"post\" name=\"aForm\">");
@@ -577,5 +577,5 @@
 	}
 	else{
-	matShell = "source "+ gsdl3Root + fileSeparator + "ext" + fileSeparator + "mat" + fileSeparator + "bin" + fileSeparator +"script" + fileSeparator + "mat-colbuild-download.bash "
+	matShell = gsdl3Root + fileSeparator + "ext" + fileSeparator + "mat" + fileSeparator + "bin" + fileSeparator +"script" + fileSeparator + "mat-colbuild-download.bash "
 	    + collName
 	    + " "
@@ -601,5 +601,5 @@
 	out.flush();
 	Process p = processShell(matShell, out);
-	
+
 	if (p.exitValue() == 0){
 	    out.println("<p>Collection downloaded.</p>");
@@ -615,5 +615,5 @@
 	String matShell2 = "";
 
-		matShell2 = "source "+ gsdl3Root + fileSeparator + "ext" + fileSeparator +"mat"+ fileSeparator +"bin" + fileSeparator + "script" + fileSeparator + "mat-colbuild.bash "
+		matShell2 = gsdl3Root + fileSeparator + "ext" + fileSeparator +"mat"+ fileSeparator +"bin" + fileSeparator + "script" + fileSeparator + "mat-colbuild.bash "
 	    + collName
 	    + " "
@@ -740,17 +740,18 @@
     	    String[] args = new String[]{"sh", "-c", command};
 	    Process p = Runtime.getRuntime().exec(args);
+
 	    BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
 	    BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));	    
 	    StringBuffer stdInputBuffer = new StringBuffer();
-    	    
+
 	    while ((s = stdInput.readLine()) != null) {
     		stdInputBuffer.append(s+"\n");
-    		if(s.indexOf("-->")!=-1){
+		if(s.indexOf("-->")!=-1){
 		    s = s.replaceAll("-->", "");
 		    out.println("<!-- " + s + " -->");
-    		}
-    		else{
+		}
+		else{
 		    out.println("<!-- " + s + " -->");
-    		}
+		}
 		out.flush();
 	    }
@@ -823,5 +824,5 @@
 	    if(status){
 		    
-	    	out.println("<script type=\"text/javascript\" language=\"JavaScript\"    src = \"http://"+hostName+":"+port_number+"/greenstone3/mat/script/getInfomation.js\">");
+	    	out.println("<script type=\"text/javascript\" language=\"JavaScript\"    src = \"http://"+hostName+":"+port_number+"/mat/script/getInfomation.js\">");
 	    	out.println("reconfig();");
 	    	out.println("</script>");
@@ -865,6 +866,6 @@
 	    titleString ="<title>"+ prop.getProperty("Servlet.Title")+"</title>";
 	    h1String ="<h2>"+ prop.getProperty("Servlet.Head")+"</h2>";
-	    cssString = "<link rel=\"stylesheet\" href=\"http://"+hostName+":"+port_number+"/greenstone3/mat/script/mat.css\" type=\"text/css\" >";
-	    javaScript = "<script type=\"text/javascript\" src=\"http://"+hostName+":"+port_number+"/greenstone3/mat/script/status3.js\"></script>";;
+	    cssString = "<link rel=\"stylesheet\" href=\"http://"+hostName+":"+port_number+"/mat/script/mat.css\" type=\"text/css\" >";
+	    javaScript = "<script type=\"text/javascript\" src=\"http://"+hostName+":"+port_number+"/mat/script/status3.js\"></script>";;
 	    headerString2 = "<head>" + titleString + "\n" +  javaScript + cssString+"</head>\n";
 	    headerString ="<head>" + titleString + "\n" + cssString + "</head>\n";
