I don't know if this qualifies as a bug or a feature proposal.

I am using Structs as a framework to a sample application that generates
a report.  The application has two kinds of users (regular and superuser),
who must set certain parameters before doing POST to /report.do
The problem is that regular users go directly to /report.do (via GET)
and "print" must be "=screen" for them, which is achieved by setting the
property of the form bean to "screen" in form's reset() method.  On the
other hand, superusers go to report from a JSP page (via POST), where they
select the parameter value like this:

<html:form name="reportForm" method="POST" action="/report.do">
  <html:radio name="print" value="printer"/> Printer-friendly
  <html:radio name="print" value="screen"/> Screen-friendly
  <input type="submit">
</html:form>

Since the form doesn't exist when JSP is called, it's created with
print=screen, and superuser see the second radio-button checked, where
is the business requirement is that the first is selected by default.
Unfortunately, <html:radio> does not allow overriding form's default
settings.  It would be nice to do something like this:

<html:form name="reportForm" method="POST" action="/report.do">
  <html:radio name="print" value="printer" checked="true"/> Printer-friendly
  <html:radio name="print" value="screen"/>                 Screen-friendly
  <input type="submit">
</html:form>

which takes precedence over default values from reset() method if the form
didn't exist in the first place.  It seems like a simple thing to do, but
I don't know if this can make its way to Struts 1.0

Also, it would be correct to have a method in the ActionForm inteface that 
indicates to the action class whether the form properties were populated 
from the request or they were set to default values by the form's reset() 
method (something like HttpSession.isNew() ).

YS.

-----Original Message-----
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 12, 2001 5:31 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Last Call for Struts 1.0 Bugs


The few remaining Struts bug reports are feeling kind of lonely.  Do you
have any more bugs that you would like to see fixed before Struts 1.0 is
released?  If so, please post them to the bug tracking system at:

    http://nagoya.apache.org/bugzilla/

under product "Struts".  Even if the bug has been reported to a Struts
mailing list, this is the best way to ensure that your bug does not get
missed in the final rush towards release.

Feature requests are welcome as well, of course, but the focus right at
the moment is on identifying and squashing any remaining bugs so that
1.0 comes out of the box as an extremely solid platform for building web
applications.

Craig McClanahan

Reply via email to