Author: ivaynberg Date: Mon Aug 3 17:29:30 2009 New Revision: 800470 URL: http://svn.apache.org/viewvc?rev=800470&view=rev Log: WICKET-2413 better exception handling for WicketSessionFilter Issue: WICKET-2413
Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java?rev=800470&r1=800469&r2=800470&view=diff ============================================================================== --- wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java (original) +++ wicket/trunk/wicket/src/main/java/org/apache/wicket/protocol/http/servlet/WicketSessionFilter.java Mon Aug 3 17:29:30 2009 @@ -151,6 +151,14 @@ if (sessionKey == null) { WebApplication application = (WebApplication)Application.get(filterName); + if (application == null) + { + throw new IllegalStateException( + "Could not find wicket application mapped to filter: " + + filterName + + ". Make sure you set filterName attribute to the name of the wicket filter " + + "for the wicket application whose session you want to access."); + } sessionKey = application.getSessionAttributePrefix(null, filterName) + Session.SESSION_ATTRIBUTE_NAME;