class WebContextBase extends Context {

    @Override
    public String contentType() {
        return header(Constants.HEADER_CONTENT_TYPE);
    }


    private String contentCharset;

    @Override
    public String contentCharset() {<FILL_FUNCTION_BODY>}

    /**
     * 输出为文件
     */
    @Override
    public void outputAsFile(DownloadedFile file) throws IOException {
        OutputUtils.global().outputFile(this, file, file.isAttachment());
    }

    /**
     * 输出为文件
     */
    @Override
    public void outputAsFile(File file) throws IOException {
        OutputUtils.global().outputFile(this, file, true);
    }


    /**
     * 获取 sessionId
     */
    @Override
    public final String sessionId() {
        return sessionState().sessionId();
    }

    /**
     * 获取 session 状态
     *
     * @param name 状态名
     */
    @Override
    public final <T> T session(String name, Class<T> clz) {
        return sessionState().sessionGet(name, clz);
    }

    /**
     * 获取 session 状态（泛型转换，存在风险）
     *
     * @param name 状态名
     */
    @Override
    public final <T> T sessionOrDefault(String name, @NonNull T def) {
        if (def == null) {
            return (T) session(name, Object.class);
        }

        Object tmp = session(name, def.getClass());
        if (tmp == null) {
            return def;
        } else {
            return (T) tmp;
        }
    }

    /**
     * 获取 session 状态，并以 int 型输出
     *
     * @param name 状态名
     * @since 1.6
     */
    @Override
    public final int sessionAsInt(String name) {
        return sessionAsInt(name, 0);
    }

    /**
     * 获取 session 状态，并以 int 型输出
     *
     * @param name 状态名
     * @since 1.6
     */
    @Override
    public final int sessionAsInt(String name, int def) {
        Object tmp = session(name, Object.class);
        if (tmp == null) {
            return def;
        } else {
            if (tmp instanceof Number) {
                return ((Number) tmp).intValue();
            } else if (tmp instanceof String) {
                String str = (String) tmp;
                if (str.length() > 0) {
                    return Integer.parseInt(str);
                }
            }

            return def;
        }
    }

    /**
     * 获取 session 状态，并以 long 型输出
     *
     * @param name 状态名
     * @since 1.6
     */
    @Override
    public final long sessionAsLong(String name) {
        return sessionAsLong(name, 0L);
    }

    /**
     * 获取 session 状态，并以 long 型输出
     *
     * @param name 状态名
     * @since 1.6
     */
    @Override
    public final long sessionAsLong(String name, long def) {
        Object tmp = session(name, Object.class);
        if (tmp == null) {
            return def;
        } else {
            if (tmp instanceof Number) {
                return ((Number) tmp).longValue();
            } else if (tmp instanceof String) {
                String str = (String) tmp;
                if (str.length() > 0) {
                    return Long.parseLong(str);
                }
            }

            return def;
        }
    }

    /**
     * 获取 session 状态，并以 double 型输出
     *
     * @param name 状态名
     * @since 1.6
     */
    @Override
    public final double sessionAsDouble(String name) {
        return sessionAsDouble(name, 0.0D);
    }

    /**
     * 获取 session 状态，并以 double 型输出
     *
     * @param name 状态名
     * @since 1.6
     */
    @Override
    public final double sessionAsDouble(String name, double def) {
        Object tmp = session(name, Object.class);
        if (tmp == null) {
            return def;
        } else {
            if (tmp instanceof Number) {
                return ((Number) tmp).doubleValue();
            } else if (tmp instanceof String) {
                String str = (String) tmp;
                if (str.length() > 0) {
                    return Double.parseDouble(str);
                }
            }

            return def;
        }
    }

    /**
     * 设置 session 状态
     *
     * @param name 状态名
     * @param val  值
     */
    @Override
    public final void sessionSet(String name, Object val) {
        sessionState().sessionSet(name, val);
    }

    /**
     * 移除 session 状态
     *
     * @param name 状态名
     */
    @Override
    public final void sessionRemove(String name) {
        sessionState().sessionRemove(name);
    }

    /**
     * 清空 session 状态
     */
    @Override
    public final void sessionClear() {
        sessionState().sessionClear();
    }


    protected Map<String, List<UploadedFile>> _filesMap = null;
    /**
     * 删除所有临时文件
     * */
    @Override
    public void filesDelete() throws IOException{
        if(_filesMap != null){
            //批量删除临时文件
            for (List<UploadedFile> files : _filesMap.values()) {
                for (UploadedFile file : files) {
                    file.delete();
                }
            }
        }
    }

    //一些特殊的boot才有效
    protected void innerCommit() throws IOException {
    }
}

        if (contentCharset == null) {
            contentCharset = HeaderUtils.extractQuotedValueFromHeader(contentType(), "charset");

            if (Utils.isEmpty(contentCharset)) {
                contentCharset = ServerProps.request_encoding;
            }

            if (Utils.isEmpty(contentCharset)) {
                contentCharset = Solon.encoding();
            }
        }

        return contentCharset;
    
<methods>public non-sealed void <init>() ,public java.lang.String accept() ,public org.noear.solon.core.handle.Action action() ,public abstract void asyncComplete() throws java.io.IOException,public abstract void asyncStart(long, org.noear.solon.core.handle.ContextAsyncListener) ,public void asyncStart() ,public abstract boolean asyncSupported() ,public T attr(java.lang.String, T) ,public T attr(java.lang.String) ,public void attrClear() ,public Map<java.lang.String,java.lang.Object> attrMap() ,public T attrOrDefault(java.lang.String, T) ,public void attrSet(java.lang.String, java.lang.Object) ,public void attrSet(Map<java.lang.String,java.lang.Object>) ,public boolean autoMultipart() ,public void autoMultipart(boolean) ,public java.lang.String body() throws java.io.IOException,public java.lang.String body(java.lang.String) throws java.io.IOException,public byte[] bodyAsBytes() throws java.io.IOException,public abstract java.io.InputStream bodyAsStream() throws java.io.IOException,public java.lang.String bodyNew() throws java.io.IOException,public void bodyNew(java.lang.String) ,public void charset(java.lang.String) ,public abstract void close() throws java.io.IOException,public abstract java.lang.String contentCharset() ,public abstract long contentLength() ,public void contentLength(long) ,public abstract java.lang.String contentType() ,public void contentType(java.lang.String) ,public java.lang.String contentTypeNew() ,public java.lang.Object controller() ,public java.lang.String cookie(java.lang.String) ,public java.lang.String cookie(java.lang.String, java.lang.String) ,public abstract org.noear.solon.core.NvMap cookieMap() ,public java.lang.String cookieOrDefault(java.lang.String, java.lang.String) ,public void cookieRemove(java.lang.String) ,public void cookieSet(java.lang.String, java.lang.String) ,public void cookieSet(java.lang.String, java.lang.String, int) ,public void cookieSet(java.lang.String, java.lang.String, java.lang.String, int) ,public abstract void cookieSet(java.lang.String, java.lang.String, java.lang.String, java.lang.String, int) ,public static org.noear.solon.core.handle.Context current() ,public org.noear.solon.core.handle.UploadedFile file(java.lang.String) throws java.io.IOException,public List<org.noear.solon.core.handle.UploadedFile> files(java.lang.String) throws java.io.IOException,public abstract void filesDelete() throws java.io.IOException,public abstract Map<java.lang.String,List<org.noear.solon.core.handle.UploadedFile>> filesMap() throws java.io.IOException,public abstract void flush() throws java.io.IOException,public void forward(java.lang.String) ,public boolean getHandled() ,public java.util.Locale getLocale() ,public boolean getRendered() ,public java.lang.String header(java.lang.String) ,public java.lang.String header(java.lang.String, java.lang.String) ,public abstract void headerAdd(java.lang.String, java.lang.String) ,public abstract org.noear.solon.core.NvMap headerMap() ,public abstract java.lang.String headerOfResponse(java.lang.String) ,public java.lang.String headerOrDefault(java.lang.String, java.lang.String) ,public abstract void headerSet(java.lang.String, java.lang.String) ,public java.lang.String[] headerValues(java.lang.String) ,public abstract Map<java.lang.String,List<java.lang.String>> headersMap() ,public java.lang.String ip() ,public boolean isFormUrlencoded() ,public boolean isMultipart() ,public boolean isMultipartFormData() ,public abstract boolean isSecure() ,public org.noear.solon.core.handle.Handler mainHandler() ,public abstract java.lang.String method() ,public abstract void output(byte[]) ,public abstract void output(java.io.InputStream) ,public void output(java.lang.String) ,public void output(java.lang.Throwable) ,public abstract void outputAsFile(org.noear.solon.core.handle.DownloadedFile) throws java.io.IOException,public abstract void outputAsFile(java.io.File) throws java.io.IOException,public void outputAsHtml(java.lang.String) ,public void outputAsJson(java.lang.String) ,public abstract java.io.OutputStream outputStream() throws java.io.IOException,public java.lang.String param(java.lang.String) ,public java.lang.String param(java.lang.String, java.lang.String) ,public T paramAsBean(Class<T>) ,public java.math.BigDecimal paramAsDecimal(java.lang.String) ,public java.math.BigDecimal paramAsDecimal(java.lang.String, java.math.BigDecimal) ,public double paramAsDouble(java.lang.String) ,public double paramAsDouble(java.lang.String, double) ,public int paramAsInt(java.lang.String) ,public int paramAsInt(java.lang.String, int) ,public long paramAsLong(java.lang.String) ,public long paramAsLong(java.lang.String, long) ,public abstract org.noear.solon.core.NvMap paramMap() ,public java.lang.String paramOrDefault(java.lang.String, java.lang.String) ,public void paramSet(java.lang.String, java.lang.String) ,public java.lang.String[] paramValues(java.lang.String) ,public void paramsAdd(java.lang.String, java.lang.String) ,public abstract Map<java.lang.String,List<java.lang.String>> paramsMap() ,public java.lang.String path() ,public java.lang.String pathAsLower() ,public java.lang.String pathAsUpper() ,public org.noear.solon.core.NvMap pathMap(java.lang.String) ,public void pathNew(java.lang.String) ,public java.lang.String pathNew() ,public abstract java.lang.String protocol() ,public java.lang.String protocolAsUpper() ,public abstract java.lang.String queryString() ,public java.lang.String realIp() ,public void redirect(java.lang.String) ,public abstract void redirect(java.lang.String, int) ,public abstract java.lang.String remoteIp() ,public abstract int remotePort() ,public boolean remoting() ,public void remotingSet(boolean) ,public final void render(java.lang.Object) throws java.lang.Throwable,public final void render(java.lang.String, Map<java.lang.String,?>) throws java.lang.Throwable,public final java.lang.String renderAndReturn(java.lang.Object) throws java.lang.Throwable,public abstract java.lang.Object request() ,public abstract java.lang.Object response() ,public final java.lang.Object session(java.lang.String) ,public abstract T session(java.lang.String, Class<T>) ,public T session(java.lang.String, T) ,public abstract double sessionAsDouble(java.lang.String) ,public abstract double sessionAsDouble(java.lang.String, double) ,public abstract int sessionAsInt(java.lang.String) ,public abstract int sessionAsInt(java.lang.String, int) ,public abstract long sessionAsLong(java.lang.String) ,public abstract long sessionAsLong(java.lang.String, long) ,public abstract void sessionClear() ,public abstract java.lang.String sessionId() ,public abstract T sessionOrDefault(java.lang.String, T) ,public abstract void sessionRemove(java.lang.String) ,public abstract void sessionSet(java.lang.String, java.lang.Object) ,public org.noear.solon.core.handle.SessionState sessionState() ,public void setHandled(boolean) ,public void setLocale(java.util.Locale) ,public void setRendered(boolean) ,public abstract int status() ,public void status(int) ,public void statusSet(int) ,public abstract java.net.URI uri() ,public abstract java.lang.String url() ,public java.lang.String userAgent() <variables>private boolean _remoting,private java.lang.String accept,private boolean allowMultipart,private Map<java.lang.String,java.lang.Object> attrMap,private java.lang.String body,private java.lang.String bodyNew,protected java.nio.charset.Charset charset,private java.lang.String contentTypeNew,public java.lang.Throwable errors,private boolean handled,java.lang.Boolean isFormUrlencoded,java.lang.Boolean isMultipart,java.lang.Boolean isMultipartFormData,private java.util.Locale locale,private java.lang.String path,private java.lang.String pathAsLower,private java.lang.String pathAsUpper,private java.lang.String pathNew,private java.lang.String protocolAsUpper,private java.lang.String realIp,private boolean rendered,public java.lang.Object result,protected org.noear.solon.core.handle.SessionState sessionState