You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/11/23 23:33:12 UTC

[Bug 54198] New: Improve HttpServletResponse#sendError(int) JavaDoc description

https://issues.apache.org/bugzilla/show_bug.cgi?id=54198

            Bug ID: 54198
           Summary: Improve HttpServletResponse#sendError(int) JavaDoc
                    description
           Product: Tomcat 6
           Version: 6.0.36
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Servlet & JSP API
          Assignee: dev@tomcat.apache.org
          Reporter: 1983-01-06@gmx.net
    Classification: Unclassified

This methods calls sendError(int, null) internally. Thus generating a HTML page
without a message. This is not mentioned in the docs. One could assume that the
response will be empty.

One could duplicate the first paragraph of the sendError(int,String) method and
alter it to "The server defaults to creating the response to look like an
HTML-formatted server error page with any specific message, setting the content
type to "text/html",..." further "If an error-page declaration has been made
for the web application corresponding to the status code passed in, it will be
served back." (Might need improvement in this case, I am not a native speaker).

Moreover, I would add "This method is effectively the same as calling
sendError(int, null)". Plus add @see #sendError(int,String).

Though the JavaDocs seems to be a verbatim copy of Oracle's Servlet API, it
does not reveal this information explicitly.

Should I provide a patch if that doc is available in svn.apache.org?

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54198] Improve HttpServletResponse#sendError(int) JavaDoc description

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54198

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Fixed in trunk, 7.0.x and 6.0.x. Will be included in 7.0.34 and 6.0.37.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54198] Improve HttpServletResponse#sendError(int) JavaDoc description

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54198

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54198] Improve HttpServletResponse#sendError(int) JavaDoc description

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54198

--- Comment #2 from Michael Osipov <19...@gmx.net> ---
(In reply to comment #1)
> (In reply to comment #0)
> > sendError(int) methods calls sendError(int, null) internally. Thus generating a HTML
> > page without a message. This is not mentioned in the docs. One could assume
> > that the response will be empty.
> 
> The sendError() method behaviour is defined by several chapters of the
> Servlet specification. In "Servlet 3.0 Rev a":
> 
> a) ch.5.3 Convenience Methods
> b) ch.10.9 Error Handling
> 
> It does not matter much which of sendError(..) methods is called.
> 
> > seems to be a verbatim copy of Oracle's Servlet API
> 
> It is the other way around. The origin is in the old times when Tomcat was
> the reference implementation. Tomcat Javadocs were maintained as the
> official ones at that time.

Well, this does not mean that we cannot improve the doc for sendError(int). I
dont think that one has to read the spec to understand what a method really
does. That's the purpose of JavaDoc actually, at least to me.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 54198] Improve HttpServletResponse#sendError(int) JavaDoc description

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54198

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> ---
(In reply to comment #0)
> sendError(int) methods calls sendError(int, null) internally. Thus generating a HTML
> page without a message. This is not mentioned in the docs. One could assume
> that the response will be empty.

The sendError() method behaviour is defined by several chapters of the Servlet
specification. In "Servlet 3.0 Rev a":

a) ch.5.3 Convenience Methods
b) ch.10.9 Error Handling

It does not matter much which of sendError(..) methods is called.

> seems to be a verbatim copy of Oracle's Servlet API

It is the other way around. The origin is in the old times when Tomcat was the
reference implementation. Tomcat Javadocs were maintained as the official ones
at that time.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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