I would like to add another one:
request.getParameter(String)
what should it return if the request came from a POST
but the value was not filled out in a form, also if the
parameter is present in a GET but no value is specified
for it.
I keep checking my parameters for a null and then for a
zero length String, I think the spec. should specify this
to ease the code up a bit.
if this is specified somewhere else like the http 1.0 spec.
could someone please let me know.
thanks
.henric
----- Original Message -----
From: Howard Melman <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 20, 1999 9:55 PM
Subject: Comments on Version 2.1a spec
In trying to implement the 2.1a servlet spec, I found a
number of things underspecified. I was hoping someone
(perhaps from sun) could clarify some of these questions. I
also hope this is the right place to send this. I found no
other address listed in the spec or on the servlet web
pages.
Howard
ServletContext.getResourceAsStream(String)
Shouldn't this be able to throw IOException? What should
this function do if it was not able to open a stream to the
URL? Return null?
ServletContext.getAttribute(String, Object)
I assume the intention is that existing attributes should be
overwritten. If this is the case, this behavior should be
specified.
ServletContext.removeAttribute(String)
What should this function do if the attribute is not there?
As it stands there is no way for the caller to be notified.
It could throw, or since it currently returns void, why not
change it to return a boolean. true on success and false if
not found. The caller could still ignore the return.
ServletRequest.getReader()
What if the request did not contain a body? Should this
funtion return null? Or should it throw an exception?
IllegalStateException doesn't seem to be the right thing.
ServletRequest.setAttribute(String, Object)
It seems that the obvious implementation is to use a
Hashtable for the attributes. But Hashtables don't allow
null values. What should happen if the value passed in is
null? Does a conforming implemenation have to support it?
Also, why is there no corresponding removeAttribute()
method?
HttpServletRequest.getAuthType()
What if there is not authentication scheme in the request?
Should this function return null or an empty string or
something else?
HttpServletResponse.sendError(...)
HttpServletResponse.sendRedirect(...)
The last sentence of the descriptions to each is:
No further output should be made by the servlet after
calling this method.
What should a conforming servlet engine do if they try to
send more output?
HttpSession.setMaxInactiveInterval(int)
The spec says it should return int, I believe this meant to
say a void return.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html