You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/02/21 03:20:50 UTC

DO NOT REPLY [Bug 33666] New: - ServletRequestConfiguration getList null pointer exception

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=33666

           Summary: ServletRequestConfiguration getList null pointer
                    exception
           Product: Commons
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Keywords: PatchAvailable
          Severity: normal
          Priority: P2
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: doychi-lists@doychi-dina.ath.cx


There seems to be a problem when retrieving a list from the
ServletRequestConfiguration.  This apears to be because the getProperty() uses
getPrarameter(key) rather than getParameterValues().  I suggest the method
should look something like (limited testing show that this works):

    public Object getProperty(String key)
    {
        String[] props = request.getParameterValues(key); 
        Object result;
        List results;
        
        if (props != null) {
            result = null;
        } else if ( props.length > 1 ) {
            results = Arrays.asList(props);
            result = results;
        } else {
            result = props[0];
        }
        
        return result;
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org