Revision: 415
          http://svn.sourceforge.net/stripes/?rev=415&view=rev
Author:   tfenne
Date:     2006-09-25 19:19:33 -0700 (Mon, 25 Sep 2006)

Log Message:
-----------
Fix for STS-243: hidden tag does not output a tag if the value is null (file 
should have been in prevoius commit)

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  
2006-09-26 02:16:32 UTC (rev 414)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/WizardFieldsTag.java  
2006-09-26 02:19:33 UTC (rev 415)
@@ -14,14 +14,15 @@
  */
 package net.sourceforge.stripes.tag;
 
+import net.sourceforge.stripes.action.ActionBean;
 import net.sourceforge.stripes.controller.StripesConstants;
-import net.sourceforge.stripes.action.ActionBean;
 import net.sourceforge.stripes.exception.StripesJspException;
+import net.sourceforge.stripes.util.CollectionUtil;
 
 import javax.servlet.jsp.JspException;
+import java.util.HashSet;
+import java.util.Map;
 import java.util.Set;
-import java.util.HashSet;
-import java.util.Enumeration;
 
 /**
  * <p>Examines the request and include hidden fields for all parameters that 
have do
@@ -63,6 +64,7 @@
         excludes.addAll( form.getRegisteredFields() );
         excludes.add( StripesConstants.URL_KEY_SOURCE_PAGE );
         excludes.add( StripesConstants.URL_KEY_FIELDS_PRESENT );
+        excludes.add( StripesConstants.URL_KEY_EVENT_NAME );
 
         // Use the submitted action bean to eliminate any event related 
parameters
         ActionBean submittedActionBean = (ActionBean)
@@ -90,11 +92,12 @@
             hidden.setParent( getParent() );
 
             // Loop through the request parameters and output the values
-            Enumeration<String> parameterNames = 
getPageContext().getRequest().getParameterNames();
-            while ( parameterNames.hasMoreElements() ) {
-                String name = parameterNames.nextElement();
+            Map<String,String[]> params = 
getPageContext().getRequest().getParameterMap();
+            for (Map.Entry<String,String[]> entry : params.entrySet()) {
+                String name = entry.getKey();
+                String[] values = entry.getValue();
 
-                if ( !excludes.contains(name) ) {
+                if ( !excludes.contains(name) && !CollectionUtil.empty(values) 
 ) {
                     hidden.setName(name);
                     try {
                         hidden.doStartTag();


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to