Skip to content

Commit

Permalink
set content type and encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Apr 1, 2015
1 parent 5d24a9d commit 86465f2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public static void methodNotAllowed ( final HttpServletRequest request, final Ht

public static void notFound ( final HttpServletRequest request, final HttpServletResponse response ) throws IOException
{
response.setCharacterEncoding ( "UTF-8" );
response.setContentType ( "text/plain" );

response.setStatus ( HttpServletResponse.SC_NOT_FOUND );
response.getWriter ().println ( String.format ( "Resource '%s' could not be found", Requests.getOriginalPath ( request ) ) );
}
Expand Down

0 comments on commit 86465f2

Please sign in to comment.