Thai Thanh Ha wrote:
> Hi all,
>
> I have found this code in the Struts example (file:
> EditRegistrationAction.java, line: 144)
>
> if (form == null) {
> ...
> }
>
> When EditRegistrationAction.perform() is called, form will be a reference
> to a RegistrationForm (*never* be null, because the ActionForm object has
> been created before by the ActionServlet object). Is it correct? Why has the
> author written this code? Can anyone help me?
>
The "form" object passed to an Action will indeed be null if the
struts-config.xml file does not define an "input" attribute for this particular
action.
Although that is not the case currently for the Struts example app, consider me
an old paranoid programmer about double checking the "it can never happen" cases
... :-)
>
> Regards,
> Thai
Craig McClanahan