DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7478>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7478

java.lang.NullPointerException in AbstractValidatorAction

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED



------- Additional Comments From [EMAIL PROTECTED]  2002-03-27 13:18 -------
Please try this and see if it's ok.
I tried http://localhost:8080/cocoon/formvalidation/test
and it works.

 -°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°-°

    /**
     * Returns the value of 'nullable' attribute from given configuration or
     * from given constraints, value present in constrints takes precedence,
     * false when attribute is not present in either of them.
     */
    private boolean getNullable(Configuration conf, Configuration cons) {
        /* check nullability */
        try {
            String tmp = cons.getAttribute("nullable");
            return "yes".equals(tmp) || "true".equals(tmp);
        } catch (ConfigurationException e) {
           getLogger().debug ("Error while using constraints: "+e);
        } catch (NullPointerException npe) {
           getLogger().debug ("NullPointerException while using 
constraints: "+npe);
        } finally {
            getLogger().debug ("Using configuration instead of 
constraints.");             
            String tmp = conf.getAttribute("nullable", "no");
            return "yes".equals(tmp) || "true".equals(tmp);
        }        
    }

    /**
     * Returns the default value from given configuration or constraints.
     * Value present in constraints takes precedence, null is returned when no
     * default attribute is present in eiher of them.
     */
    private String getDefault(Configuration conf, Configuration cons) {
        String dflt = null;
        try {
            dflt = cons.getAttribute("default");
        } catch (ConfigurationException e) {
           getLogger().debug ("Error while using constraints: "+e);
        } catch (NullPointerException npe) {
           getLogger().debug ("NullPointerException while using 
constraints: "+npe);
        } finally {
           getLogger().debug ("Using configuration instead of 
constraints.");        
           dflt = conf.getAttribute("default", "");
        }    
        
        if ("".equals(dflt.trim())) {
            dflt = null;
        }
        return dflt;
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to