You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by fr...@apache.org on 2006/11/07 09:20:06 UTC

svn commit: r472022 - /incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/MockServletContext.java

Author: frankbille
Date: Tue Nov  7 00:20:05 2006
New Revision: 472022

URL: http://svn.apache.org/viewvc?view=rev&rev=472022
Log:
Use the OS's tmp directory instead of the project directory for session pagestores when using MockApplication.

Modified:
    incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/MockServletContext.java

Modified: incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/MockServletContext.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/MockServletContext.java?view=diff&rev=472022&r1=472021&r2=472022
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/MockServletContext.java (original)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/protocol/http/MockServletContext.java Tue Nov  7 00:20:05 2006
@@ -43,6 +43,7 @@
 import org.apache.commons.logging.LogFactory;
 
 import wicket.Application;
+import wicket.WicketRuntimeException;
 import wicket.util.value.ValueMap;
 
 /**
@@ -110,6 +111,19 @@
 		mimeTypes.put("gif", "image/gif");
 		mimeTypes.put("jpg", "image/jpeg");
 		mimeTypes.put("png", "image/png");
+
+		// Set ServletContext temp dir
+		try
+		{
+			File tmpDir = File.createTempFile("wicket", null);
+			tmpDir.delete();
+			tmpDir.mkdir();
+			setAttribute("javax.servlet.context.tempdir", tmpDir);
+		}
+		catch (IOException e)
+		{
+			throw new WicketRuntimeException(e);
+		}
 	}
 
 	/**