All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cq.web.servlet.ServletConfig Maven / Gradle / Ivy

The newest version!
package cq.web.servlet;

import cq.web.servlet.annotation.AllowOrigin;
import cq.web.servlet.annotation.Handle;
import cq.web.servlet.annotation.NotOrigin;
import cq.web.servlet.annotation.Param;
import cq.web.servlet.annotation.RequestBody;
import cq.web.servlet.annotation.Response;
import cq.web.servlet.annotation.Upload;
import cq.web.servlet.annotation.Web;

public interface ServletConfig {
    Class ANNOTATION_WEB = Web.class;
    Class ANNOTATION_HANDLE = Handle.class; //处理请求
    Class ANNOTATION_PARAM = Param.class; //请求参数
    Class ANNOTATION_UPLOAD = Upload.class; //文件上传   Servlet3.0+
    Class ANNOTATION_REQUEST_BODY = RequestBody.class; //所有请求参数
    Class ANNOTATION_RESPONSE = Response.class; //函数返回值作为响应
    Class ANNOTATION_ALLOW_ORIGIN = AllowOrigin.class; //处理跨域
    Class ANNOTATION_NOT_ORIGIN = NotOrigin.class;

    /**
     * 初始化需要加载的包
     */
    String[] initPackage();

    /**
     * 是否扫描子包
     */
    boolean isScanerChildPack();

    /**
     * 设置字符编码
     */
    String charset();

    /**
     * 初始化请求路径不存在提示
     */
    String handleNotFondMsg();

    /**
     * 初始化请求方式错误字符串
     */
    String requestMethodErrorMsg();

    /**
     * 是否在Console输出请求参数信息
     */
    boolean isPrintRequestInfo2Console();

    /**
     * 初始化时自定义操作
     */
    void onStart();

    /**
     * 销毁时自定义操作
     */
    void onDestroy();

    /**
     * 拦截url
     *
     * @return
     */
    String urlPattern();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy