EB> There is a contract between actions and the forms they use:  The form 
EB> *will* be created.  This can be evidenced by the source (see 
EB> RequestProcessor.java).

Dirk wrote:
> Yes, the form does exist. As Reinhard wrote the NPE occurs
> *inside* the validate methods. Seems like the validate methods is
> using objects which do not exist.

Given the facts above, can someone comment on this code in the
struts-example webapp?

from EditSubscriptionAction.java in the execute() method:

      // Populate the subscription form
        if (form == null) {
            if (log.isTraceEnabled()) {
                log.trace(" Creating new SubscriptionForm bean under key "
                          + mapping.getAttribute());
            }
            form = new SubscriptionForm();
            if ("request".equals(mapping.getScope())) {
                request.setAttribute(mapping.getAttribute(), form);
            } else {
                session.setAttribute(mapping.getAttribute(), form);
            }
        }

Is that whole block just not necessary?  

-- 
Wendy Smoak
http://sourceforge.net/projects/unidbtags 

Reply via email to