You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by eh...@apache.org on 2006/10/15 19:25:52 UTC
svn commit: r464233 -
/incubator/wicket/trunk/wicket/src/main/java/wicket/markup/html/PackageResource.java
Author: ehillenius
Date: Sun Oct 15 10:25:51 2006
New Revision: 464233
URL: http://svn.apache.org/viewvc?view=rev&rev=464233
Log:
better throw an abort exception (e.g. for when last modified requests are made for non-existing resources)
Modified:
incubator/wicket/trunk/wicket/src/main/java/wicket/markup/html/PackageResource.java
Modified: incubator/wicket/trunk/wicket/src/main/java/wicket/markup/html/PackageResource.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/markup/html/PackageResource.java?view=diff&rev=464233&r1=464232&r2=464233
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/markup/html/PackageResource.java (original)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/markup/html/PackageResource.java Sun Oct 15 10:25:51 2006
@@ -25,6 +25,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import wicket.AbortException;
import wicket.Application;
import wicket.RequestCycle;
import wicket.SharedResources;
@@ -341,13 +342,14 @@
String msg = "Unable to find package resource [path = " + absolutePath + ", style = "
+ style + ", locale = " + locale + "]";
log.warn(msg);
- if (RequestCycle.get() instanceof WebRequestCycle)
+ RequestCycle requestCycle = RequestCycle.get();
+ if (requestCycle instanceof WebRequestCycle)
{
throw new AbortWithWebErrorCodeException(HttpServletResponse.SC_NOT_FOUND, msg);
}
else
{
- throw new WicketRuntimeException(msg);
+ throw new AbortException();
}
}
this.locale = resourceStream.getLocale();