0

Hi I am getting a HTTP Status 500 - An exception occurred processing JSP page /registration.jsp at line 15 error. The page is a registration jsp page that submits the following parametres into the database. However there are no hints in Eclipse as to what caused the error. Can someone help me please?

<%@ page import ="java.sql.*" %>

<%

    String user = request.getParameter("uname");    `
    String pwd = request.getParameter("pass");
    String fname = request.getParameter("first_name");
    String lname = request.getParameter("last_name");
    String email = request.getParameter("email");
    Class.forName("org.postgresql.Driver");
    Connection con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/demo",
            "postgres", "8755Block1F");
    Statement st = con.createStatement();
    //ResultSet rs;
    int i = st.executeUpdate("INSERT INTO members(first_name, last_name, email, uname, pass) VALUES ('" + fname + "','" + lname + "','" + email + "','" + user + "','" + pwd);
    if (i > 0) {
        //session.setAttribute("userid", user);
        response.sendRedirect("welcome.jsp");
       // out.print("Registration Successfull!"+"<a href='index.jsp'>Go to Login</a>");
    } else {
        response.sendRedirect("index.jsp");
    }

%>

3
Contributors
2
Replies
17
Views
3 Years
Discussion Span
Last Post by jwenting
0

You have to check your Java server where kyou deploying that code for logs. It is not job of IDE to give you crash reports of server based Java application.

Secondly why the hell to use ugly scriptlets inside JSP instead of servlet????

0

as to the second, that code looks about a decade old so he probably uses a decade old book (or more likely a pdf someone ripped from a decade old book and put on some website as "free jsp book").

What's line 15, and what's the error? Check your server logs as Peter suggests, the answer should be pretty bloody obvious from those.
In fact I can see at least one glaring error in the SQL you generate (and that's not counting the extreme vulnerability to SQL injection attacks you're opening yourself to).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.