@@ -0,0 +1,3068 @@
+/*%0A * To change this template, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0A%0A%0Aimport java.io.IOException;%0Aimport java.io.PrintWriter;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport java.util.ArrayList;%0A/**%0A *%0A * @author kd%0A */%0Apublic class Main extends HttpServlet %7B%0A   %0A    /** %0A     * Processes requests for both HTTP %3Ccode%3EGET%3C/code%3E and %3Ccode%3EPOST%3C/code%3E methods.%0A     * @param request servlet request%0A     * @param response servlet response%0A     * @throws ServletException if a servlet-specific error occurs%0A     * @throws IOException if an I/O error occurs%0A     */%0A    protected void processRequest(HttpServletRequest request, HttpServletResponse response)%0A    throws ServletException, IOException %7B%0A        response.setContentType(%22text/html;charset=UTF-8%22);%0A        PrintWriter out = response.getWriter();%0A        try %7B%0A            TariffDAO a = null;%0A            TokenDAO b = null;%0A            ArrayList %3CTariff%3E a1= a.findAll();%0A            ArrayList %3CToken%3E b1= b.findAll();%0A%0A%0A            %0A            out.println(%22%3Chtml%3E%22);%0A            %0A            out.println(%22%3Chead%3E%22);%0A            out.println(%22%3Ctitle%3EServlet Main%3C/title%3E%22);  %0A            out.println(%22%3C/head%3E%22);%0A            out.println(%22%3Cbody%3E%22);%0A            out.println(%22tokenid:%22);%0A            out.println(%22password%22);%0A            out.println(%22city%22);%0A            out.println(%22medium%22);%0A            out.println(%22startPlace%22);%0A            out.println(%22stopPlace%22);%0A            out.println(%22Fare%22);%0A            out.println(%22kedar%22);%0A            out.println(%22%3C/body%3E%22);%0A            out.println(%22%3C/html%3E%22);%0A            %0A        %7D finally %7B %0A            out.close();%0A        %7D%0A    %7D %0A%0A    // %3Ceditor-fold defaultstate=%22collapsed%22 desc=%22HttpServlet methods. Click on the + sign on the left to edit the code.%22%3E%0A    /** %0A     * Handles the HTTP %3Ccode%3EGET%3C/code%3E method.%0A     * @param request servlet request%0A     * @param response servlet response%0A     * @throws ServletException if a servlet-specific error occurs%0A     * @throws IOException if an I/O error occurs%0A     */%0A    @Override%0A    protected void doGet(HttpServletRequest request, HttpServletResponse response)%0A    throws ServletException, IOException %7B%0A        processRequest(request, response);%0A    %7D %0A%0A    /** %0A     * Handles the HTTP %3Ccode%3EPOST%3C/code%3E method.%0A     * @param request servlet request%0A     * @param response servlet response%0A     * @throws ServletException if a servlet-specific error occurs%0A     * @throws IOException if an I/O error occurs%0A     */%0A    @Override%0A    protected void doPost(HttpServletRequest request, HttpServletResponse response)%0A    throws ServletException, IOException %7B%0A        processRequest(request, response);%0A    %7D%0A%0A    /** %0A     * Returns a short description of the servlet.%0A     * @return a String containing servlet description%0A     */%0A    @Override%0A    public String getServletInfo() %7B%0A        return %22Short description%22;%0A    %7D// %3C/editor-fold%3E%0A%0A%7D%0A

Create Main.java