/*******************************************************************************
 * Copyright (c) 2014 IBH SYSTEMS GmbH.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBH SYSTEMS GmbH - initial API and implementation
 *******************************************************************************/
package de.dentrassi.osgi.web.util;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public final class Responses
{
    private Responses ()
    {
    }

    public static final String LAST_MODIFIED = "Last-Modified";

    public static void methodNotAllowed ( final HttpServletRequest request, final HttpServletResponse response ) throws IOException
    {
        response.setStatus ( HttpServletResponse.SC_METHOD_NOT_ALLOWED );
    }

    public static void notFound ( final HttpServletRequest request, final HttpServletResponse response ) throws IOException
    {
        response.setStatus ( HttpServletResponse.SC_NOT_FOUND );
        response.getWriter ().println ( String.format ( "Resource '%s' could not be found", Requests.getOriginalPath ( request ) ) );
    }
}

@@ -1154,32 +1154,134 @@
 Exception%0A    %7B%0A
+        response.setCharacterEncoding ( %22UTF-8%22 );%0A        response.setContentType ( %22text/plain%22 );%0A%0A
         response

set content type and encoding