cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject The contract of Request.get() ?
Date Mon, 12 Jul 2004 06:41:56 GMT
It seems to me that the contract of the get() method on the 
Request object is not defined very well.

The javadoc says:
     * Returns the value of the named attribute as an <code>Object</code>,
     * or <code>null</code> if no attribute of the given name exists.
So, from this I would conclude that it's the same as getAttribute(name),
so it's superfluous.
In fact, the CLI Request object does implement it in this way.

But :) the http request implementation, does the following:

    if (req instanceof MultipartHttpServletRequest) {
        return ((MultipartHttpServletRequest) req).get(name);
    } else {
        // This is a shortened version of the exact code:
        return req.getParameterValues(name);

So, this implementation is not about attributes at all! Looking through
our code, it seems get() is used whenever it comes to handle an uploaded

I think we should correct the javadocs and the implementation
for the CLI.



Carsten Ziegeler 
Open Source Group, S&N AG

View raw message