struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean A. Hoover" <>
Subject form processing
Date Wed, 19 May 2004 23:59:17 GMT
I don't quite understand how DynaActionForm
gets populated when a form is submitted. The
form I have gets processed exactly as I expect,
except for a group of checkboxes (generated in
JSP by a custom tag I wrote). If I have one or
more checked it works fine. However, if I uncheck
all of them, it fails. The boxes come in checked
as they were before I unchecked all. I'm using
struts 1.1 and am generating
some checkboxes that look like this in
the JSP:

<form name="seriesProps" method="post" action="/" style="margin-bottom:0;">
<td valign="top"><input type="checkbox" name="categoryIds" value="2"/></td>
<td class="text" valign="top">
<img src="images/spacer.gif" width="1" height="1" alt="">Health &amp; Fitness<br/>
<table cellpadding="0" cellspacing="0">
<td valign="top"><input type="checkbox" name="categoryIds" value="6"/></td>
<td class="text" valign="top"><img src="images/spacer.gif" width="1" height="1" alt="">Diet<br/>
<td valign="top"><input type="checkbox" name="categoryIds" value="7"/></td>
<td class="text" valign="top">
<img src="images/spacer.gif" width="1" height="1" alt="">Fitness<br/>

When it hits my ChangeSeriesProps Action:
   public ActionForward execute
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response
    ) throws Exception
        DynaActionForm vForm = (DynaActionForm)form;
        log.debug("AAA: change properties: " + vForm.toString());

The log shows:
2004-05-19 18:47:38 DEBUG - AAA: change properties: DynaActionForm[dynaClass=seriesProps,categoryIds={7},title=Life's
a Bowl of Cherries xxx,description=Life is indeed a bowl of cherries xxx,strategy=weekdays,weekdays={Monday,Wednesday,Friday}]

The struts-config.xml has this definition:

    <form-bean name="seriesProps"
      <form-property name="title"
      <form-property name="description"
      <form-property name="categoryIds"
      <form-property name="strategy"
                     type="java.lang.String" initial="deltaDays"/>
      <form-property name="weekdays"
    <action path="/ChangeSeriesProps"
      <forward name="success" path="/"/>
      <forward name="failure" path="/"/>
      <forward name="cancel" path="/"/>

Any ideas why categoryIds is *not* empty?

Dean Hoover

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message