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

com.github.quartzwebui.http.QuartzWebUIServlet Maven / Gradle / Ivy

The newest version!
/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package com.github.quartzwebui.http;

import com.github.quartzwebui.service.QuartzWebUIService;
import com.github.quartzwebui.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

/**
 * 负责处理业务servlet
 * @author quxiucheng [[email protected]]
 */
public class QuartzWebUIServlet extends ResourceServlet {

    private static final Logger logger = LoggerFactory.getLogger(QuartzWebUIServlet.class);

    public static final String PARAM_RESOURCE_PATH = "resourcePath";


    private QuartzWebUIService quartzWebUIService = QuartzWebUIService.getInstance();

    /**
     * 设置资源路径
     * @throws ServletException
     */
    public void init() throws ServletException {
        super.init();
        // 用户是否有配置新的资源路径
        String paraResourcePath = getInitParameter(PARAM_RESOURCE_PATH);
        if (!StringUtils.isEmpty(paraResourcePath)) {
            setResourcePath(paraResourcePath);
        }
    }

    protected String process(String url, HttpServletRequest request, HttpServletResponse response) {
        return quartzWebUIService.service(url, request, response);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy