Jetty
  1. Jetty
  2. JETTY-1501

Setting custom error response message changes page title

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 7.5.4
    • Fix Version/s: 7.6.6, 8.1.6
    • Component/s: Servlet
    • Labels:
      None
    • Number of attachments :
      0

      Description

      There is a method in org.eclipse.jetty.server.Response: public void sendError(int code, String message)

      When message is not null it gets placed in both the title and body of the page. In other servers, such as Tomcat, the default behavior is to change the body but leave the title unchanged. For example, Tomcat has a property org.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER which defaults to false. It may be worth adding such an option in Jetty, or changing the behavior of sendError such that the message is not inserted into the title.

        Activity

        Jan Bartel made changes -
        Field Original Value New Value
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Jan Bartel made changes -
        Assignee Jan Bartel [ janb ]
        Hide
        Jan Bartel added a comment -

        Added new method on ErrorHandler called setShowMethodInTitle(boolean).

        Configured on a webapp/context in xml like so:

         <Get name="errorHandler">
            <Set name="showMessageInTitle">false</Set>
         </Get>
        

        Fixed for 7.6.6/8.1.6

        Show
        Jan Bartel added a comment - Added new method on ErrorHandler called setShowMethodInTitle(boolean). Configured on a webapp/context in xml like so: <Get name="errorHandler"> <Set name="showMessageInTitle">false</Set> </Get> Fixed for 7.6.6/8.1.6
        Jan Bartel made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 7.6.6 [ 18672 ]
        Fix Version/s 8.1.6 [ 18671 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Jan Bartel
            Reporter:
            Jason Resch
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: