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

Reply via email to