Ir ao conteúdo
  • Cadastre-se
paulo._victor._

HTML HTTP Status 404 - Not Found

Recommended Posts

Olá, "terminei" de desenvolver um projeto web no netbeans sem que este acusasse nenhum erro.. Ao colocar para rodar e fazer comunicação com wampserver ele deu esse erro:

 

image.png.49f9e85f43ed09259e804c6ee1b0477d.png

 

Revisei o código varias e varias vezes, corrigi algumas coisas e o erro persistiu.. Ao criar a conexão, fiz o teste e funcionou.. Mas nada do app rodar.. Vou colocar trechos de códigos de cada pagina a seguir:

 

------------------------------------------------------------------------------------------------------------------------------------------------------

 

acesso.jsp

<%@page import="java.sql.*"%>
<%
    Class.forName("org.gjt.mm.mysql.Driver");
    String bd = "jdbc:mysql://localhost:3306/agendamento";
    Connection con = DriverManager.getConnection(bd, "root", "");
    Statement banco = con.createStatement();

%>

 

------------------------------------------------------------------------------------------------------------------------------------------------------

 

login.html

 

image.thumb.png.06443ec60c5affab10c4d15a40651697.png

 

 

------------------------------------------------------------------------------------------------------------------------------------------------------

 

validaLogin.jsp


 

<%@include file="acesso.jsp" %>



<% String pesquisar = "SELECT * FROM usuario "
            + "WHERE usuario = '"
            + request.getParameter("usuario")
            + "' AND senha = md5('"
            + request.getParameter("senha")
            + "')";



  ResultSet resultado = banco.executeQuery(pesquisar);
    String mensagem;



    if (resultado.next()) {
        RequestDispatcher pagina = request.getRequestDispatcher("agendamento.jsp");
        pagina.include(request, response);
    }



   else {
        mensagem = "Usuario/Senha Incorreta";
        RequestDispatcher pagina = request.getRequestDispatcher("login.html");
        pagina.include(request, response);
    }

%>

------------------------------------------------------------------------------------------------------------------------------------------------------

 

cadastro.jsp

<!DOCTYPE html>
<html>



    <head>

        <link href="css/cadastro.css" rel="stylesheet">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Cadastro de Cliente</title>

    </head>



    <style>  

        body{
            background: url(imagem/imagem.jpg) no-repeat center center fixed;
            -webkit-background-size: cover;
            -moz-background-size: cover;
            -o-background-size: cover;
            background-size: cover;

        }

    </style>



    <script type="text/javascript">

        function Cancelar()
        {
            location.href = "login.html";
        }

    </script>



    <script>

        function SomenteNumero(e) {
            var tecla = (window.event) ? event.keyCode : e.which;
            if ((tecla > 47 && tecla < 58))
                return true;
            else {
                if (tecla == 8 || tecla == 0)
                    return true;
                else
                    return false;
            }
        }
    </script>



    <body>



        <div id="cadastro-box">

            <div id="cadastro-box-name">Formulario de Cadastro</div>

            <form action="cadCadastro.jsp" method="POST">

                <table>

                    <tr>
                        <td>Nome:</td>
                        <td> <input type="text" name="nome" size="45" maxlength="45" required placeholder="Nome completo"></td>        
                    </tr>

                    <tr>
                        <td>Endereco:</td>
                        <td> <input type="text" name="endereco" size="45" maxlength="45" required placeholder="Rua, Travessa, Alameda, Quadra..."></td>        
                    </tr>

                    <tr>
                        <td>Numero:</td>
                        <td> <input type="text" name="numero" size="45" maxlength="4"  onkeypress='return SomenteNumero(event)'></td>        
                    </tr>

                    <tr>
                        <td>Complemento: </td>
                        <td><input type="text" name="complemento" size="45" maxlength="45" required placeholder="Comercio, Bar, Escola..."></td>        
                    </tr>

                    <tr>
                        <td>Cep:</td>
                        <td><input type="text" name="cep" size="20" maxlength="8" onkeypress='return SomenteNumero(event)'></td>        
                    </tr>        

                    <tr>
                        <td>Data de Nascimento:</td>
                        <td><input type="date" name="data" min="1950-01-01" max="2018-12-31" > </td>        
                    </tr>

                    <tr>
                        <td>CPF:</td>
                        <td><input type="text" name="cpf" size="45" maxlength="11" onkeypress='return SomenteNumero(event)' required placeholder="Apenas Numeros"></td>        
                    </tr>

                    <tr>
                        <td>Telefone:</td>
                        <td><input type="text" name="telefone" size="14" maxlength="11" onkeypress='return SomenteNumero(event)' required placeholder="989****-****"></td>        
                    </tr>

                    <tr>
                        <td>E-mail:</td>
                        <td><input type="text" name="e-mail" size="45" maxlength="45" required placeholder="exemple@gmail.com"></td>        
                    </tr>

                    <tr>
                        <td>Usuario:</td>
                        <td><input type="text" name="usuario" size="45" maxlength="11" onkeypress='return SomenteNumero(event)' required placeholder="Para maior comodidade, utilize seu CPF"></td>        
                    </tr>

                    <tr>
                        <td>Senha:</td>
                        <td><input type="text" name="senha" size="45" maxlength="8" required placeholder="Senha com até 8 dígitos"></td>        
                    </tr>

                </table>

                <input type="submit" value="Concluir Cadastro">
                <input type="reset" value="Cancelar Cadastro" onClick="Cancelar()">
            </form>
        </div>

                
    </body>

</html>



------------------------------------------------------------------------------------------------------------------------------------------------------



cadCadastro.jsp



<%@include file="acesso.jsp"%>



<% try {
        String inserir = "INSERT INTO livro VALUES ("
                + request.getParameter("nome") + ", '"
                + request.getParameter("endereco") + "', '"
                + request.getParameter("numero") + "', '"
                + request.getParameter("complemento") + "', '"
                + request.getParameter("cep") + "')"
                + request.getParameter("data de nascimento") + "', '"
                + request.getParameter("cpf") + "', '"
                + request.getParameter("telefone") + "', '"
                + request.getParameter("e-mail") + "', '"
                + request.getParameter("usuario") + "', '"
                + request.getParameter("senha") + "', '";

        banco.executeUpdate(inserir);
%>



<script>
    
    alert('Cadastro concluido com sucesso!');
    window.location.href = "agendamento.jsp";
    
</script>



<%
    } catch (SQLException excecao) {
        out.println("Ocorreu um erro inesperado com a comunicação com Banco de Dados.");
    }
%>

 

------------------------------------------------------------------------------------------------------------------------------------------------------

 

agendamento.jsp


 

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>


<html>


    <head>

        <link href="css/agendamento.css" rel="stylesheet">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Agendamento de Clientes</title>

    </head>



    <style>

        body {

            background: url(imagem/imagem.jpg) no-repeat center center fixed;
            -webkit-background-size: cover;
            -moz-background-size: cover;
            -o-background-size: cover;
            background-size: cover;    
        }

    </style>



    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />

   

<body>

        <div id="agendamento-box">
            <div id="agendamento-box-name"> Agendamento </div>      

           

<form action="cadAgendamento.jsp" method="POST">

                <div class="table-responsive">
                    <table class="table table-hover">

                        <thead>
                            <tr>
                                <th>Agendamento</th>
                                <th>Data</th>
                                <th>Horario</th>
                            </tr>
                        </thead>


                        <tbody>

                            <tr>
                                <td>
                                    <input type="radio" name="botao" id="botao1" />
                                    <label for="radio1"></label>
                                </td>
                                <td><input type="date" name="data" min="2018-05-24" max="2018-12-23"></td>
                                <td><input type="time" name="hora" min="08:00" max="18:00"></td>
                            </tr>

                            <!-- <tr>
                                   <td>
                                     <input type="radio" name="botao" id="botao2" />
                                     <label for="radio2"></label>
                                   </td>
                                   <td><input type="date" name="data" min="2018-05-24" max="2018-12-23"></td>
                                   <td>09h as 10h</td>
                             </tr>
                             
                                   <tr>
                                   <td>
                                     <input type="radio" name="botao" id="botao3" />
                                     <label for="radio3"></label>
                                   </td>
                                   <td><input type="date" name="data" min="2018-05-24" max="2018-12-23"></td>
                                   <td>10h as 11h</td>
                             </tr>
                             
                            <tr>
                                   <td>
                                     <input type="radio" name="botao" id="botao4" />
                                     <label for="radio4"></label>
                                   </td>
                                   <td><input type="date" name="data" min="2018-05-24" max="2018-12-23"></td>
                                   <td>11h as 12h</td>
                             </tr>
                             
                                   <tr>
                                   <td>
                                     <input type="radio" name="botao" id="botao5" />
                                     <label for="radio5"></label>
                                   </td>
                                   <td><input type="date" name="data" min="2018-05-24" max="2018-12-23"></td>
                                   <td>14h as 15h</td>
                             </tr>
                             
                            <tr>
                                   <td>
                                     <input type="radio" name="botao" id="botao6" />
                                     <label for="radio6"></label>
                                   </td>
                                   <td><input type="date" name="data" min="2018-05-24" max="2018-12-23"></td>
                                   <td>15h as 16h</td>
                             </tr>
                             
                                   <tr>
                                   <td>
                                     <input type="radio" name="botao" id="botao7" />
                                     <label for="radio7"></label>
                                   </td>
                                   <td><input type="date" name="data" min="2018-05-24" max="2018-12-23"></td>
                                   <td>16h as 17h</td>
                             </tr>
                             
                            <tr>
                                   <td>
                                     <input type="radio" name="botao" id="botao8" />
                                     <label for="radio8"></label>
                                   </td>
                                   <td><input type="date" name="data" min="2018-05-24" max="2018-12-23"></td>
                                   <td>17h as 18h</td>
                             </tr> -->
                        </tbody>

                    </table>
                    <input type="submit" value="Salvar Agendamento">
                    <Input type="button" value="Consultar agendamentos Salvos">
                </div>
            </form>
        </div>

    </body>

</html>     

------------------------------------------------------------------------------------------------------------------------------------------------------

 

cadAgendamento.jsp

<%@include file="acesso.jsp"%>

<% try {
        String inserir = "INSERT INTO livro VALUES ("
                + request.getParameter("radio1") + ", '"
                + request.getParameter("data") + "', '"
                + request.getParameter("hora") + "')";

        banco.executeUpdate(inserir);
%>

<script>
    alert('Agendamento cadastrado com sucesso!');
    window.location.href = "jsp/agendados.jsp";
</script>

<%
    } catch (SQLException excecao) {
        out.println("Ocorreu um erro inesperado com a comunicação com o Banco de Dados.");
    }
%>

 

------------------------------------------------------------------------------------------------------------------------------------------------------

 

altAgendamento.jsp

<%@include file = "acesso.jsp"%>
<%    String selecionar = "SELECT * FROM livro WHERE codLvro=" + request.getParameter("codLivro");
    ResultSet res = banco.executeQuery(selecionar);
    if (res.next()) {
%>


<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Alteração de Agendamento</title>
    </head>
    <body>
        <h1>Alteração de Livro</h1>
        <form action="altAgendamentoConf.jsp" method="POST">

            <table>

                <thead>
                    <tr>
                        <th></th>
                        <th></th>
                    </tr>
                </thead>

                <tbody>

                    <tr>
                        <td>Agendamento</td>
                        <td><input type="radio" name="data" value="<%=res.getBoolean("radio1")%>" /></td>
                    </tr>
                    
                    <tr>
                        <td>Data</td>
                        <td><input type="date" name="data" value="<%=res.getString("data")%>" /></td>
                    </tr>

                    <tr>
                        <td>Hora</td>
                        <td><input type="time" name="hora" value="<%=res.getString("hora")%>" /></td>
                    </tr>


                    <tr>
                        <td></td>
                        <td><input type="submit" value="Alterar Agendamento" /></td>
                    </tr>

                </tbody>
            </table>
        </form>

        <%
            }
        %>

    </body>
</html>

 

------------------------------------------------------------------------------------------------------------------------------------------------------

 

altAgendamentoConf.jsp

<%@include file="acesso.jsp"%>
<%    String alterar = "UPDATE livro SET titulo = '" + request.getParameter("radio1") + "', data = '"
            + request.getParameter("data") +  "', hora = '"
            + request.getParameter("hora") + "' "
            + "WHERE codLivro =" + request.getParameter("radio1");

    banco.executeUpdate(alterar);
%>

<script>

    alert('O agendamento foi atualizado com sucesso');
    window.locatiom.href = 'agendados.jsp';

</script>

 

 

------------------------------------------------------------------------------------------------------------------------------------------------------

 

apAgendamento.jsp

<%@include file="acesso.jsp" %>

<%String apagar = "DELETE * FROM livro WHERE codLivro = " + request.getParameter("radio1");
    banco.executeUpdate(apagar);
%>

<script>
    alert('Agendamento apagado com sucesso!');
    window.location.href = "agendados.jsp";
</script>

 

------------------------------------------------------------------------------------------------------------------------------------------------------

 

agendados.jsp


 

<%@include file="acesso.jsp" %>

<%String buscar = "SELECT * FROM livro ORDER BY titulo";
    ResultSet resultado = banco.executeQuery(buscar);
%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>
    <head>

        <link href="css/agendados.css" rel="stylesheet">
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Agendados</title>

    </head>

    <style>

        body {

            background: url(imagem/imagem.jpg) no-repeat center center fixed;
            -webkit-background-size: cover;
            -moz-background-size: cover;
            -o-background-size: cover;
            background-size: cover;    
        }

    </style>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />

    <body>

        <div id="agendamento-box">
            <div id="agendamento-box-name"> Agendamentos Finalizados </div>      

            <div class="table-responsive">
                <table class="table table-hover">

                    <tr>
                        <th>Cliente</th>
                        <th>Data</th>
                        <th>Horario</th>
                    </tr>

                    <%
                        while (resultado.next()) {
                            int cod = resultado.getInt("nome");
                    %>

                    <tr>
                        <td><%=resultado.getString("nome")%></td>
                        <td><%=resultado.getString("data")%></td>
                        <td><%=resultado.getString("horario")%></td>

                        <td>
                            <a href="altAgendamento.jsp?agendamento=<%=cod%>"><input type="button" value="Editar"></a>
                            <a href="apAgendamento.jsp?agendamento=<%=cod%>"><input type="button" value="Apagar"></a>                            
                        </td>
                    </tr>

                    <%
                        }
                    %>

                </table>
                <a href="agendamento.jsp"><input type="reset" value="Voltar">
                    </div>            
                    </div>            
                    </body>
                    </html>     

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

Crie uma conta ou entre para comentar

Você precisar ser um membro para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar agora





Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas publicações sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×