Erro ao acessar servlet

0 respostas
daojavamysqlservlet
H

Boa tarde a todos,

Estou com um problema e não estou entendo o que esta acontecendo, no meu projeto tenho uma página onde passo parâmetros para um servlet chamado CronogramaNegocio, aparentemente a passagem esta o pelo que vejo na URL

http://localhost:8080/Qualidade/CronogramaNegocio?departamento=LIVROS+FISCAIS&hData=2018-11-06&hInicio=21%3A01&hFim=01%3A01&tipoAuditoria=1�PARTE&frm_length=10

Porém o resultado é:

HTTP Status 404 - /Qualidade/CronogramaNegocio
type Status report

message /Qualidade/CronogramaNegocio

description The requested resource is not available.

Apache Tomcat/7.0.56

Pelo que estou vendo no meu código não estou conseguindo achar o erro, alguém consegue me ajudar?

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.CronogramaAuditoria;
import model.DAO.CronogramaAuditoriaDAO;

/**
 *
 * @author Rafael H. Aguiar
 */
public class CronogramaNegocio extends HttpServlet {

/**
 * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
 * methods.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    try (PrintWriter out = response.getWriter()) {
                  System.out.print("Entrou no metodo de salvar Cronograma");

        String metodo = request.getParameter("metodo");
        String tipoAuditoria = request.getParameter("tipoAuditoria");
        String data = request.getParameter("data");
        String departamento = request.getParameter("departamento");
        String hInicio = request.getParameter("hInicio");
        String hFim = request.getParameter("hFim");

        
        CronogramaAuditoriaDAO croDAO = new CronogramaAuditoriaDAO();
        
        

        if ((metodo != null) && (metodo.equals("salvar"))) { //SALVAR
            CronogramaAuditoria cro = new CronogramaAuditoria(tipoAuditoria, data, hInicio, hFim, departamento);
            croDAO.create(cro);
                    System.out.print("Registro salvo com sucesso");

       
}
    }
}

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
 * Handles the HTTP <code>GET</code> method.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    processRequest(request, response);
}

/**
 * Handles the HTTP <code>POST</code> method.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    processRequest(request, response);
}

/**
 * Returns a short description of the servlet.
 *
 * @return a String containing servlet description
 */
@Override
public String getServletInfo() {
    return "Short description";
}// </editor-fold>

}
Criado 11 de novembro de 2018
Respostas 0
Participantes 1