HTML Form Submission and JSP mySQL

dark legend

New Member
I recently made an HTML page that validates the form submission so that the submission has values for name, email address, gender, comments, and same passwords. Right now, I'm trying to implement so these values for each form can be inserted into a database. Below are snippets of the codeHTML portion\[code\] <form id="regForm" action="insertInfo.jsp" onsubmit="return validation();" method="post" enctype="text/plain"> <fieldset> <legend>Registration</legend> <p>Name: <input type="text" name="name" id="name"/></p> <p>Email Address: <input type="text" name="emailAddress" id="emailAddress"/></p> <p>Gender: <input type="radio" name="gender" id="genderM" value="http://stackoverflow.com/questions/15737908/Male" /> Male <input type="radio" name="gender" id="genderF" value="http://stackoverflow.com/questions/15737908/Female" /> Female </p> <p>Password: <input type="password" name="password_1" id="password_1"/></p> <p>Confirm Password: <input type="password" name="password_2" id="password_2"/></p> <p>Comments: <input type="text" name="comments" id="comments"/></p> <p><input type="submit" name="submit" value="http://stackoverflow.com/questions/15737908/Submit"/></p> </fieldset> </form>\[/code\]JSP code named as insertInfo.jsp\[code\]<%@ page import="java.sql.*" %><% String connectionURL = "jdbc:mysql://sql.school.edu:3306/user"; Connection connection = null; Statement statement = null; ResultSet rs = null; Class.forName("com.mysql.jdbc.Driver").newInstance(); connection = DriverManager.getConnection(connectionURL, "user", "password"); statement = connection.createStatement(); String name=request.getParameter("name"); String password=request.getParameter("password_1"); String email=request.getParameter("emailAddress"); String gender=request.getParameter("gender"); String comments=request.getParameter("comments"); rs = statement.executeQuery("INSERT INTO Information VALUES ('"+name+"', '"+password+"', '"+email+"', '"+gender="', '"+comments+"')");%>\[/code\]When I try to submit a form, I get prompted to a page similar to \[quote\] HTTP Status 404 - /~user/insertInfo.jsp type Status report message /~user/insertInfo.jsp description The requested resource (/~user/insertInfo.jsp) is not available. Apache Tomcat/5.5.29\[/quote\]I'm confused as to why this is occurring. Also, the HTML and JSP file are in the same public_html directory.
 
Back
Top