r1041 - trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component
Author: mfortun Date: 2011-07-04 16:10:35 +0200 (Mon, 04 Jul 2011) New Revision: 1041 Url: http://nuiton.org/repositories/revision/wikitty/1041 Log: * correction for an exception throwed to soon Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java Modified: trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java =================================================================== --- trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java 2011-07-04 13:23:21 UTC (rev 1040) +++ trunk/wikitty-struts/src/main/java/org/nuiton/wikitty/struts/component/AbstractWikittyComponent.java 2011-07-04 14:10:35 UTC (rev 1041) @@ -38,17 +38,8 @@ handler = (WikittyFieldHandler) stack.getContext().get( WikittyFieldHandler.WIKITTY_STACK_KEY); - if (handler == null && wikitty == null) { - log.info("Handler not found in the stack"); - // TODO mfortun-2011-06-29 throw exception if handler not in the - // stack + } - throw new TagUseException( - "Tag must declare Wikitty attribute if used outside ws:form tag"); - } - - } - public boolean isIncluded(String fieldName) { if (handler != null) { return handler.isIncluded(fieldName); @@ -73,6 +64,16 @@ @Override protected void evaluateExtraParams() { super.evaluateExtraParams(); + + if (handler == null && wikitty == null) { + log.info("Handler not found in the stack and wikitty not declared"); + + + throw new TagUseException( + "Tag must declare Wikitty attribute if used outside ws:form tag"); + + } + if (fqFieldName != null) { addParameter("fqFieldName", fqFieldName); }
participants (1)
-
mfortun@users.nuiton.org