Details
-
Improvement
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
1.3.0-beta1, 1.3.0-beta2
-
None
Description
I'm not sure how long we've had this, but I bumped my head against the fact that if you provide invalid keys (or missing) for variable substitution you get a big fat error page. That is fine for development but absolutely not fine for production/ when resource setting throwExceptionOnMissingResource is false. Even though the name of this setting does not cover missing/ wrong keys, it has the same goal: when true, it fails fast so that when you're developing you'll have to fix it if you want to go on, but when in production, such errors should never cause the application to stop functioning.
It looks to me like
Index: /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java
===================================================================
— /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java (revision 567432)
+++ /Users/eelcohillenius/Documents/workspace_wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java (working copy)
@@ -26,6 +26,7 @@
import java.util.Locale;
import java.util.Map;
+import org.apache.wicket.Application;
import org.apache.wicket.Component;
import org.apache.wicket.Localizer;
import org.apache.wicket.MarkupContainer;
@@ -196,7 +197,8 @@
*/
public String substitute(String string, Map vars) throws IllegalStateException
/**
is the best fix.