Wicket stores everything other than the current Page for a given user’s session (by default) in a second-level disk-based session cache.
I’d never looked much into how it worked, until I wanted to know where these files were located.
The answer as it turns out makes a lot of sense – here’s the method that does the work in the DiskPageStore.java -
private static File getDefaultFileStoreFolder()
{
final File dir = (File)((WebApplication)Application.get()).getServletContext()
.getAttribute("javax.servlet.context.tempdir");
if (dir != null)
{
return dir;
}
else
{
try
{
return File.createTempFile("file-prefix", null).getParentFile();
}
catch (IOException e)
{
throw new WicketRuntimeException(e);
}
}
}
So by default it tries to use the servlet container’s local context’s temporary location, in a Wicket folder underneath. If that fails it attempts to grab the system’s temporary folder.
For Apache Tomcat, that means a folder under your webapps context in apache-tomcat/work/Catalina/… e.g.
Related posts:
