使用jetty servlet打开jsp页面

时间:2013-10-01 14:17:02

标签: jsp servlets jetty

一切! 我使用 jetty + maven + eclipse ,我想使用AuthenticationServlet打开jsp页面

我的主要课程:

server = new Server();
        connector = new ServerConnector(server);
        connector.setPort(9090);
        server.setConnectors(new Connector[]{connector});

ContextHandlerCollection contexts = new ContextHandlerCollection();
        server.setHandler(contexts);

        ServletContextHandler root = new ServletContextHandler(contexts, "/", ServletContextHandler.SESSIONS);
        root.addServlet(new ServletHolder(new AuthenticationServlet()),"/");

我的Servlet:

@Override
     protected void doGet(HttpServletRequest request, HttpServletResponse response)
     {


        try {
            request.getRequestDispatcher("/WEB-INF/jsp/page.jsp").forward(request,response);
        } catch (ServletException e) {
            // TODO Auto-generated catch block
            System.out.println("Servlet exception: " + e.getMessage());
        } catch (IOException e) {
            // TODO Auto-generated catch block
            System.out.println("IOException" + e.getMessage());
        }

但是当我运行此代码时,我收到一个错误:HTTP 500 StackOverflow

请帮助我,如何解决这个问题...

0 个答案:

没有答案