Skip to content

Commit d7d5f16

Browse files
committed
registration form
1 parent a9afce1 commit d7d5f16

26 files changed

+329
-0
lines changed

LoginForm/.classpath

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
4+
<classpathentry kind="src" path="src/main/java"/>
5+
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v10.1">
6+
<attributes>
7+
<attribute name="owner.project.facets" value="jst.web"/>
8+
</attributes>
9+
</classpathentry>
10+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
11+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
12+
<classpathentry kind="output" path="build/classes"/>
13+
</classpath>

LoginForm/.project

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>LoginForm</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.wst.validation.validationbuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
</buildSpec>
24+
<natures>
25+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
26+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
27+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
28+
<nature>org.eclipse.jdt.core.javanature</nature>
29+
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
30+
</natures>
31+
</projectDescription>

LoginForm/.settings/.jsdtscope

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry excluding="**/node_modules/*|**/*.min.js|**/bower_components/*" kind="src" path="src/main/webapp"/>
4+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
5+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
6+
<attributes>
7+
<attribute name="hide" value="true"/>
8+
</attributes>
9+
</classpathentry>
10+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
11+
<classpathentry kind="output" path=""/>
12+
</classpath>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
4+
org.eclipse.jdt.core.compiler.compliance=17
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
7+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
9+
org.eclipse.jdt.core.compiler.release=enabled
10+
org.eclipse.jdt.core.compiler.source=17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
2+
<wb-module deploy-name="LoginForm">
3+
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
4+
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
5+
<property name="context-root" value="LoginForm"/>
6+
<property name="java-output-path" value="/LoginForm/build/classes"/>
7+
</wb-module>
8+
</project-modules>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<faceted-project>
3+
<runtime name="Apache Tomcat v10.1"/>
4+
<fixed facet="java"/>
5+
<fixed facet="wst.jsdt.web"/>
6+
<fixed facet="jst.web"/>
7+
<installed facet="java" version="17"/>
8+
<installed facet="jst.web" version="6.0"/>
9+
<installed facet="wst.jsdt.web" version="1.0"/>
10+
</faceted-project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Window
1.68 KB
Binary file not shown.
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package login;
2+
3+
import java.io.IOException;
4+
import java.io.PrintWriter;
5+
6+
import jakarta.servlet.ServletException;
7+
import jakarta.servlet.annotation.WebServlet;
8+
import jakarta.servlet.http.HttpServlet;
9+
import jakarta.servlet.http.HttpServletRequest;
10+
import jakarta.servlet.http.HttpServletResponse;
11+
12+
13+
@WebServlet("/loginForm")
14+
public class login extends HttpServlet{
15+
@Override
16+
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
17+
// TODO Auto-generated method stub
18+
// super.doGet(req, resp);
19+
20+
21+
String my_name = req.getParameter("name");
22+
String my_password = req.getParameter("password");
23+
24+
PrintWriter out = resp.getWriter();
25+
26+
out.print("<h1>Your Details</h1>");
27+
out.print("<h3>Your Name :"+my_name+"</h3>");
28+
out.print("<h3>Your Passowrd :"+my_password+"</h3>");
29+
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Class-Path:
3+

LoginForm/src/main/webapp/login.jsp

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2+
pageEncoding="ISO-8859-1"%>
3+
<!DOCTYPE html>
4+
<html>
5+
<head>
6+
<meta charset="ISO-8859-1">
7+
<title>Login Form</title>
8+
</head>
9+
<body>
10+
<form action="loginForm" method="post">
11+
Name : <input type="text" name = "name"> <br><br>
12+
Password : <input type = "password" name="passowrd"><br><br>
13+
<input type ="submit" value = "submit">
14+
</form>
15+
</body>
16+
</html>

RegistrationForm/.classpath

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
4+
<attributes>
5+
<attribute name="module" value="true"/>
6+
</attributes>
7+
</classpathentry>
8+
<classpathentry kind="src" path="src/main/java"/>
9+
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v10.1">
10+
<attributes>
11+
<attribute name="owner.project.facets" value="jst.web"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
15+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
16+
<classpathentry kind="lib" path="D:/Learnings/Java Full Stack College/mysql-connector-java-8.0.11.jar"/>
17+
<classpathentry kind="output" path="build/classes"/>
18+
</classpath>

RegistrationForm/.project

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>RegistrationForm</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.wst.validation.validationbuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
</buildSpec>
24+
<natures>
25+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
26+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
27+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
28+
<nature>org.eclipse.jdt.core.javanature</nature>
29+
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
30+
</natures>
31+
</projectDescription>

RegistrationForm/.settings/.jsdtscope

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry excluding="**/node_modules/*|**/*.min.js|**/bower_components/*" kind="src" path="src/main/webapp"/>
4+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
5+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
6+
<attributes>
7+
<attribute name="hide" value="true"/>
8+
</attributes>
9+
</classpathentry>
10+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
11+
<classpathentry kind="output" path=""/>
12+
</classpath>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
4+
org.eclipse.jdt.core.compiler.compliance=17
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
7+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
9+
org.eclipse.jdt.core.compiler.release=enabled
10+
org.eclipse.jdt.core.compiler.source=17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
2+
<wb-module deploy-name="RegistrationForm">
3+
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
4+
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
5+
<property name="context-root" value="RegistrationForm"/>
6+
<property name="java-output-path" value="/RegistrationForm/build/classes"/>
7+
</wb-module>
8+
</project-modules>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<faceted-project>
3+
<runtime name="Apache Tomcat v10.1"/>
4+
<fixed facet="wst.jsdt.web"/>
5+
<fixed facet="jst.web"/>
6+
<fixed facet="java"/>
7+
<installed facet="java" version="17"/>
8+
<installed facet="jst.web" version="6.0"/>
9+
<installed facet="wst.jsdt.web" version="1.0"/>
10+
</faceted-project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Window
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package register;
2+
3+
import java.io.IOException;
4+
import java.io.PrintWriter;
5+
import java.sql.Connection;
6+
import java.sql.DriverManager;
7+
import java.sql.PreparedStatement;
8+
9+
import jakarta.servlet.RequestDispatcher;
10+
import jakarta.servlet.ServletException;
11+
import jakarta.servlet.annotation.WebServlet;
12+
import jakarta.servlet.http.HttpServlet;
13+
import jakarta.servlet.http.HttpServletRequest;
14+
import jakarta.servlet.http.HttpServletResponse;
15+
16+
@WebServlet("/regForm")
17+
public class register extends HttpServlet {
18+
// invoke doPost method
19+
@Override
20+
// protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
21+
// TODO Auto-generated method stub
22+
// super.doGet(req, resp);
23+
// }
24+
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
25+
// TODO Auto-generated method stub
26+
// super.doPost(req, resp);
27+
28+
29+
30+
// get inputs form html to java file
31+
String my_name = req.getParameter("name1");
32+
String my_email = req.getParameter("email1");
33+
String my_password = req.getParameter("password1");
34+
PrintWriter out = resp.getWriter();
35+
out.print("<h1>Successfully Submited</h1>");
36+
37+
/*
38+
39+
// database connectivity
40+
try {
41+
Class.forName("com.mysql.cj.jdbc.Driver");
42+
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3308/registrationForm","root","Akash@123");
43+
PreparedStatement ps = conn.prepareStatement("insert into details(?,?,?)"); // ?,? = positional parameters
44+
ps.setString(1, my_name);
45+
ps.setString(2, my_email);
46+
ps.setString(3, my_password);
47+
48+
int count = ps.executeUpdate();
49+
if(count > 0) {
50+
51+
PrintWriter out = resp.getWriter();
52+
53+
resp.setContentType("text/html");
54+
out.print("<h3>Successfully Registered</h3>");
55+
RequestDispatcher rd = req.getRequestDispatcher("/register.jsp");
56+
rd.include(req, resp);
57+
}
58+
else {
59+
PrintWriter out = resp.getWriter();
60+
61+
resp.setContentType("text/html");
62+
out.print("<h3>Uncessfully Register</h3>");
63+
RequestDispatcher rd = req.getRequestDispatcher("/register.jsp");
64+
rd.include(req, resp);
65+
66+
}
67+
}
68+
catch(Exception e) {
69+
System.out.println(e);
70+
}
71+
*/
72+
73+
}
74+
75+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Class-Path:
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2+
pageEncoding="ISO-8859-1"%>
3+
<!DOCTYPE html>
4+
<html>
5+
<head>
6+
<meta charset="ISO-8859-1">
7+
<title>Insert title here</title>
8+
</head>
9+
<body>
10+
<form action="regForm" method = "post">
11+
Name : <input type = "text" name = "name1"/><br><br>
12+
Email : <input type = "text" name = "email1"/><br><br>
13+
Password : <input type = "text" name = "password1"/><br><br>
14+
<input type="submit" value="Submit">
15+
16+
17+
</form>
18+
19+
</body>
20+
</html>

0 commit comments

Comments
 (0)