Example usage for javax.servlet GenericServlet GenericServlet

List of usage examples for javax.servlet GenericServlet GenericServlet

Introduction

In this page you can find the example usage for javax.servlet GenericServlet GenericServlet.

Prototype

public GenericServlet() 

Source Link

Document

Does nothing.

Usage

From source file:br.com.bancooriginal.notificacao.servlet.SampleServletApplication.java

@SuppressWarnings("serial")
@Bean//w  ww.j  a  va2 s.co  m
public Servlet dispatcherServlet() {
    return new GenericServlet() {
        @Override
        public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
            res.setContentType("text/plain");
            res.getWriter().append("Hello World");
        }
    };
}

From source file:org.codehaus.groovy.grails.web.pages.ext.jsp.GroovyPagesPageContext.java

@SuppressWarnings("serial")
public GroovyPagesPageContext(Binding pageScope) {
    this(new GenericServlet() {
        @Override/*from www .  j ava  2  s . com*/
        public ServletConfig getServletConfig() {
            return this;
        }

        @Override
        public void service(ServletRequest servletRequest, ServletResponse servletResponse)
                throws ServletException, IOException {
            // do nothing;
        }
    }, pageScope != null ? pageScope : new Binding());
}