www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike LaRocca <laro...@fore.com>
Subject mod_jserv/5454: ServletResponse.sendError() not implemented to spec
Date Fri, 10 Dec 1999 20:03:37 GMT

>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
>Originator:     larocca@fore.com
>Release:        Apache 1.3.9 JServ 1.1b3
Application is JDK 1.2.2 based running on Solaris
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

But I found that the string specified by 'msg' is not passed to the client.
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?");
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
[In order for any reply to be added to the PR database, you need]
[to include <apbugs@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!     ]

View raw message