You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Mike LaRocca <la...@fore.com> on 1999/12/10 21:03:37 UTC

mod_jserv/5454: ServletResponse.sendError() not implemented to spec

>Number:         5454
>Category:       mod_jserv
>Synopsis:       ServletResponse.sendError() not implemented to spec
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Fri Dec 10 12:10:00 PST 1999
>Last-Modified:
>Originator:     larocca@fore.com
>Organization:
apache
>Release:        Apache 1.3.9 JServ 1.1b3
>Environment:
Application is JDK 1.2.2 based running on Solaris
>Description:
JSDK 2.0 for method sendError of ServletResponse says;

public abstract void sendError(int sc,
                                String msg) throws IOException

     Sends an error response to the client using the specified status code and descriptive message. If setStatus has previously been
     called, it is reset to the error status code. The message is sent as the body of an HTML page, which is returned to the user to
     describe the problem. The page is sent with a default HTML header; the message is enclosed in simple body tags
     (<body></body>). 

But I found that the string specified by 'msg' is not passed to the client.
>How-To-Repeat:
import javax.servlet.*;

public class Test extends HttpServlet {
    public void service (HttpServletRequest request,
                         HttpServletResponse response)
        throws ServletException, IOException {

        response.sendError(900, "What's going on?");
}
>Fix:
I realize this may be a JSDK error but if not I'd like to see actions of the API to be implemented as specified.  In particular I think it would be 
useful to only display the 'msg' string when the error doesn't map to on of the official HTTP error codes otherwise display the standard error name name and
text.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]