Revision: 950
http://stripes.svn.sourceforge.net/stripes/?rev=950&view=rev
Author: tfenne
Date: 2008-07-29 18:30:37 +0000 (Tue, 29 Jul 2008)
Log Message:
-----------
Changed to add the wizard fields tag to the tag stack so that getParent() can
work across pages.
Modified Paths:
--------------
trunk/stripes/src/net/sourceforge/stripes/tag/WizardFieldsTag.java
Modified: trunk/stripes/src/net/sourceforge/stripes/tag/WizardFieldsTag.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/WizardFieldsTag.java
2008-07-16 21:04:37 UTC (rev 949)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/WizardFieldsTag.java
2008-07-29 18:30:37 UTC (rev 950)
@@ -20,6 +20,7 @@
import net.sourceforge.stripes.util.CollectionUtil;
import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.TryCatchFinally;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@@ -36,7 +37,7 @@
*
* @author Tim Fennell
*/
-public class WizardFieldsTag extends StripesTagSupport {
+public class WizardFieldsTag extends StripesTagSupport implements
TryCatchFinally {
private boolean currentFormOnly = false;
/**
@@ -51,6 +52,7 @@
/** Skips over the body because there shouldn't be one. */
@Override
public int doStartTag() throws JspException {
+ getTagStack().push(this);
return SKIP_BODY;
}
@@ -125,4 +127,18 @@
return EVAL_PAGE;
}
+
+ /** Rethrows the passed in throwable in all cases. */
+ public void doCatch(Throwable throwable) throws Throwable { throw
throwable; }
+
+ /**
+ * Used to ensure that the input tag is always removed from the tag stack
so that there is
+ * never any confusion about tag-parent hierarchies.
+ */
+ public void doFinally() {
+ try { getTagStack().pop(); }
+ catch (Throwable t) {
+ /* Suppress anything, because otherwise this might mask any causal
exception. */
+ }
+ }
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development