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

cn.ubibi.jettyboot.framework.rest.HttpServletWrapper Maven / Gradle / Ivy

package cn.ubibi.jettyboot.framework.rest;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class HttpServletWrapper {
    private String path;
    private  HttpServlet httpServlet;
    HttpServletWrapper(String path, HttpServlet httpServlet) {
        this.path = path;
        this.httpServlet = httpServlet;
    }

    public boolean matched(String target) {
        if(target.startsWith(path)){
            return true;
        }
        return false;
    }

    public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        httpServlet.service(request,response);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy