From: <fg...@us...> - 2007-02-14 21:15:50
|
Revision: 257 http://svn.sourceforge.net/openutils/?rev=257&view=rev Author: fgiust Date: 2007-02-14 13:15:50 -0800 (Wed, 14 Feb 2007) Log Message: ----------- fix debug when no session is available, fix label mode in input tag Modified Paths: -------------- trunk/openutils-tags-spring/src/main/java/it/openutils/web/tag/debug/DebugAttributesTag.java trunk/openutils-tags-spring/src/main/resources/META-INF/tags/ou/input.tag Modified: trunk/openutils-tags-spring/src/main/java/it/openutils/web/tag/debug/DebugAttributesTag.java =================================================================== --- trunk/openutils-tags-spring/src/main/java/it/openutils/web/tag/debug/DebugAttributesTag.java 2007-02-14 17:34:52 UTC (rev 256) +++ trunk/openutils-tags-spring/src/main/java/it/openutils/web/tag/debug/DebugAttributesTag.java 2007-02-14 21:15:50 UTC (rev 257) @@ -91,19 +91,25 @@ { HashMap map = new HashMap(); - - Enumeration enm = pageContext.getAttributeNamesInScope(scope); - - while (enm.hasMoreElements()) + try { - String key = enm.nextElement().toString(); + Enumeration enm = pageContext.getAttributeNamesInScope(scope); - if (!(scope == PageContext.PAGE_SCOPE && key.startsWith("javax.servlet"))) + while (enm.hasMoreElements()) { - Object value = pageContext.getAttribute(key, scope); - map.put(key, value); + String key = enm.nextElement().toString(); + + if (!(scope == PageContext.PAGE_SCOPE && key.startsWith("javax.servlet"))) + { + Object value = pageContext.getAttribute(key, scope); + map.put(key, value); + } } } + catch (IllegalStateException e) + { + // ignore, no attributes available + } setOutputClassName(true); setDebugMap(map); Modified: trunk/openutils-tags-spring/src/main/resources/META-INF/tags/ou/input.tag =================================================================== --- trunk/openutils-tags-spring/src/main/resources/META-INF/tags/ou/input.tag 2007-02-14 17:34:52 UTC (rev 256) +++ trunk/openutils-tags-spring/src/main/resources/META-INF/tags/ou/input.tag 2007-02-14 21:15:50 UTC (rev 257) @@ -54,7 +54,7 @@ <c:set var="type" value="textarea" /> </c:if> <c:if test="${type eq 'label'}"> - <c:set var="nobind" value="true" /> + <c:set var="nobind" value="${true}" /> </c:if> <c:set var="divclass"> <jsp:text>formelement formelement${type}</jsp:text> @@ -91,7 +91,7 @@ </c:when> <c:otherwise> <div class="${divclass}"> - <label for="${name}">${labelmsg}:</label> + <label for="${name}">${labelmsg}</label> <ou:txtinput type="${type}" name="${name}" value="${status.value}" cssclass="${cssclass}" maxlength="${maxlength}" style="${style}" readonly="${readonly}" disabled="${disabled}" onkeypress="${onkeypress}" onkeydown="${onkeydown}" onkeyup="${onkeyup}" onchange="${onchange}" @@ -122,16 +122,16 @@ onkeypress="${onkeypress}" onkeydown="${onkeydown}" onkeyup="${onkeyup}" onchange="${onchange}" onblur="${onblur}" /> </c:when> - <c:when test="${label}"> + <c:when test="${type == 'label'}"> <div class="${divclass}"> - <label for="${name}">${labelmsg}:</label> + <label for="${name}">${labelmsg}</label> <span class="text">${status.value}</span> <div class="clear"><!-- --></div> </div> </c:when> <c:otherwise> <div class="${divclass}"> - <label for="${name}">${labelmsg}:</label> + <label for="${name}">${labelmsg}</label> <ou:txtinput type="${type}" name="${name}" value="${status.value}" cssclass="${cssclass}" maxlength="${maxlength}" style="${style}" readonly="${readonly}" disabled="${disabled}" onkeypress="${onkeypress}" onkeydown="${onkeydown}" onkeyup="${onkeyup}" onchange="${onchange}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |