Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java	(revision 25347)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java	(revision 25350)
@@ -28,5 +28,5 @@
 	private FilterConfig _filterConfig = null;
 	private static Logger _logger = Logger.getLogger(org.greenstone.gsdl3.core.URLFilter.class.getName());
-	
+
 	//Restricted URLs
 	protected static final String SITECONFIG_URL = "sites/[^/]+/siteConfig.xml";
@@ -58,11 +58,11 @@
 
 			String url = hRequest.getRequestURI().toString();
-			
-			if(isURLRestricted(url))
+
+			if (isURLRestricted(url))
 			{
 				response.getWriter().println("Access to this page is forbidden.");
 				return;
 			}
-			
+
 			if (url.contains("/index/assoc/"))
 			{
@@ -135,8 +135,7 @@
 
 				Element metaResponse = (Element) gsRouter.process(metaMessage);
-				GSXML.printXMLNode(metaResponse, true);
-				
+
 				NodeList metadataList = metaResponse.getElementsByTagName(GSXML.METADATA_ELEM);
-				if(metadataList.getLength() == 0)
+				if (metadataList.getLength() == 0)
 				{
 					_logger.error("Could not find the document related to this url");
@@ -144,7 +143,7 @@
 				else
 				{
-					Element metadata = (Element)metadataList.item(0);
+					Element metadata = (Element) metadataList.item(0);
 					String document = metadata.getTextContent();
-					
+
 					//Get the security info for this collection
 					Element securityMessage = gsDoc.createElement(GSXML.MESSAGE_ELEM);
@@ -158,5 +157,5 @@
 					Element securityResponse = (Element) GSXML.getChildByTagName(gsRouter.process(securityMessage), GSXML.RESPONSE_ELEM);
 					ArrayList<String> groups = GSXML.getGroupsFromSecurityResponse(securityResponse);
-					
+
 					if (!groups.contains(""))
 					{
@@ -164,5 +163,5 @@
 						for (String group : groups)
 						{
-							if (((HttpServletRequest)request).isUserInRole(group))
+							if (((HttpServletRequest) request).isUserInRole(group))
 							{
 								found = true;
@@ -170,6 +169,6 @@
 							}
 						}
-						
-						if(!found)
+
+						if (!found)
 						{
 							return;
@@ -196,6 +195,6 @@
 						gRequest.setParameter(GSParams.DOCUMENT, segments[i + 1]);
 
-						additionalParameters = new String[] { GSParams.ACTION, GSParams.DOCUMENT_TYPE, DocumentAction.EXPAND_DOCUMENT_ARG };
-						defaultParamValues = new String[] { "d", "hierarchy", "1" };
+						additionalParameters = new String[] { GSParams.ACTION, GSParams.DOCUMENT_TYPE };
+						defaultParamValues = new String[] { "d", "hierarchy" };
 					}
 					//PAGE
@@ -213,5 +212,5 @@
 
 						gRequest.setParameter("s1.authpage", pageName);
-						
+
 						additionalParameters = new String[] { GSParams.ACTION, GSParams.REQUEST_TYPE, GSParams.SUBACTION, GSParams.SERVICE };
 						defaultParamValues = new String[] { "g", "r", "authen", "Authentication" };
@@ -306,10 +305,10 @@
 		}
 	}
-	
+
 	private boolean isURLRestricted(String url)
 	{
-		for(String restrictedURL : _restrictedURLs)
-		{
-			if(url.matches(".*" + restrictedURL + ".*"))
+		for (String restrictedURL : _restrictedURLs)
+		{
+			if (url.matches(".*" + restrictedURL + ".*"))
 			{
 				return true;
@@ -341,11 +340,15 @@
 		public String getParameter(String paramName)
 		{
-			if (_newParams.containsKey(paramName))
-			{
-				return _newParams.get(paramName)[0];
+			if (super.getParameter(paramName) != null)
+			{
+				return super.getParameter(paramName);
 			}
 			else
 			{
-				return super.getParameter(paramName);
+				if (_newParams.get(paramName) != null && _newParams.get(paramName)[0] != null)
+				{
+					return _newParams.get(paramName)[0];
+				}
+				return null;
 			}
 		}
@@ -353,11 +356,11 @@
 		public String[] getParameterValues(String paramName)
 		{
-			if (_newParams.containsKey(paramName))
+			if (super.getParameterValues(paramName) != null)
+			{
+				return super.getParameterValues(paramName);
+			}
+			else
 			{
 				return _newParams.get(paramName);
-			}
-			else
-			{
-				return super.getParameterValues(paramName);
 			}
 		}
