From 4af5f616be6969b81d6c8a35b640740ac1a23f04 Mon Sep 17 00:00:00 2001 From: DanukaBhathiya Date: Mon, 9 Aug 2021 18:40:32 +0530 Subject: [PATCH 1/3] added first webApp --- .../Project1/build/built-jar.properties | 4 + .../Danuka/Project1/build/classes/Run.class | Bin 0 -> 604 bytes .../Danuka/webapp1/nb-configuration.xml | 19 +++++ CL-BSCSD-22-45/Danuka/webapp1/pom.xml | 76 ++++++++++++++++++ .../src/main/webapp/META-INF/context.xml | 2 + .../Danuka/webapp1/src/main/webapp/new1.jsp | 49 +++++++++++ 6 files changed, 150 insertions(+) create mode 100644 CL-BSCSD-22-45/Danuka/Project1/build/built-jar.properties create mode 100644 CL-BSCSD-22-45/Danuka/Project1/build/classes/Run.class create mode 100644 CL-BSCSD-22-45/Danuka/webapp1/nb-configuration.xml create mode 100644 CL-BSCSD-22-45/Danuka/webapp1/pom.xml create mode 100644 CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/META-INF/context.xml create mode 100644 CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/new1.jsp diff --git a/CL-BSCSD-22-45/Danuka/Project1/build/built-jar.properties b/CL-BSCSD-22-45/Danuka/Project1/build/built-jar.properties new file mode 100644 index 0000000..f6b41f3 --- /dev/null +++ b/CL-BSCSD-22-45/Danuka/Project1/build/built-jar.properties @@ -0,0 +1,4 @@ +#Sun, 25 Jul 2021 12:15:54 +0530 + + +C\:\\Users\\User\\OneDrive\\Desktop\\ICBTp\\icbt-22\\CL-BSCSD-22-45\\Danuka\\Project1= diff --git a/CL-BSCSD-22-45/Danuka/Project1/build/classes/Run.class b/CL-BSCSD-22-45/Danuka/Project1/build/classes/Run.class new file mode 100644 index 0000000000000000000000000000000000000000..1f71af1b29660f67676ff2183df81d1458b15f67 GIT binary patch literal 604 zcmZuu%WfJ$5Ug1q`(Oz+1h9i4e#Y2`aPbY4izO?O$V0&*hnxny!ecMH&U&$&d%h%> zoRfni<&Y1^*Z6EjPHGk;3yG1Yd%C*2s$28t{?~5+2iSFBV#UTPo>-_kSVP@H!^Be) z>jK%13RL_;Al2OK3#1Rj6HlPfRe|?rG9Gx*u^jkBirsK1{l1Kpj%Q#xK2?_jneO{Z z&}Q>ksz9L9{MbE{SF+{HVASfxkqSm_O)jo^U$IU`BesHI2ez2opPSMcPR3zia&d04=_&_zBq%FRWKV*^=!fj$Pf18iD{ zQHx&CXZC+Wd{5Fj+H3;m;PUNG3y{YnMm7pqBBGl=k<6fP{D4tR-5{On)Xc9~)?tR> z7a_j=yVa~IXx0icw0X)G5|%1$9mPbYLM8_#EHl;vHTZr^U*@%8{DmX#l2nC&f$D$8 Cuyz>$ literal 0 HcmV?d00001 diff --git a/CL-BSCSD-22-45/Danuka/webapp1/nb-configuration.xml b/CL-BSCSD-22-45/Danuka/webapp1/nb-configuration.xml new file mode 100644 index 0000000..cd0068d --- /dev/null +++ b/CL-BSCSD-22-45/Danuka/webapp1/nb-configuration.xml @@ -0,0 +1,19 @@ + + + + + + 1.7-web + Tomcat + + diff --git a/CL-BSCSD-22-45/Danuka/webapp1/pom.xml b/CL-BSCSD-22-45/Danuka/webapp1/pom.xml new file mode 100644 index 0000000..605008b --- /dev/null +++ b/CL-BSCSD-22-45/Danuka/webapp1/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + + com.mycompany + webapp1 + 1.0-SNAPSHOT + war + + webapp1 + + + ${project.build.directory}/endorsed + UTF-8 + + + + + javax + javaee-web-api + 7.0 + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + ${endorsed.dir} + + + + + org.apache.maven.plugins + maven-war-plugin + 2.3 + + false + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.6 + + + validate + + copy + + + ${endorsed.dir} + true + + + javax + javaee-endorsed-api + 7.0 + jar + + + + + + + + + + diff --git a/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/META-INF/context.xml b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/META-INF/context.xml new file mode 100644 index 0000000..c8364af --- /dev/null +++ b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/new1.jsp b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/new1.jsp new file mode 100644 index 0000000..365e6bb --- /dev/null +++ b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/new1.jsp @@ -0,0 +1,49 @@ +<%-- + Document : new1 + Created on : Aug 8, 2021, 8:15:22 PM + Author : User +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + JSP Page + + +

Hello World!

+ +

Details Table

+ + + < + + + + + < + + + + + < + + + + + < + + + + +
NameAgeAddress

Charles

54

Califonia

Dasun

26

Colombo

Nuwan

30

Kandy

+ + From 88af387fcc319f3829a584bdc8717f91fb1b99aa Mon Sep 17 00:00:00 2001 From: DanukaBhathiya Date: Thu, 19 Aug 2021 01:33:33 +0530 Subject: [PATCH 2/3] Added LoginForm --- .../src/main/webapp/META-INF/context.xml | 2 +- .../webapp1/src/main/webapp/loginform.jsp | 67 +++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/loginform.jsp diff --git a/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/META-INF/context.xml b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/META-INF/context.xml index c8364af..fd2fac1 100644 --- a/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/META-INF/context.xml +++ b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/META-INF/context.xml @@ -1,2 +1,2 @@ - + diff --git a/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/loginform.jsp b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/loginform.jsp new file mode 100644 index 0000000..7ec0dc0 --- /dev/null +++ b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/loginform.jsp @@ -0,0 +1,67 @@ +<%-- + Document : loginform + Created on : Aug 18, 2021, 11:32:36 PM + Author : User +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + + JSP Page + + +

Login

+
+
+ +
+ +
+
+
+ + Remember me +            +            +            +            + Forgot password? + + +
+
+ + From c72e6ac64f617f12e3e8d6b91c7f757c57874703 Mon Sep 17 00:00:00 2001 From: DanukaBhathiya Date: Sun, 22 Aug 2021 12:48:58 +0530 Subject: [PATCH 3/3] added user authentication(hardcode) --- .../webapp1/src/main/webapp/LoginCheck.jsp | 30 +++++++++++++++++++ .../webapp1/src/main/webapp/loginform.jsp | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/LoginCheck.jsp diff --git a/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/LoginCheck.jsp b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/LoginCheck.jsp new file mode 100644 index 0000000..e90d00e --- /dev/null +++ b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/LoginCheck.jsp @@ -0,0 +1,30 @@ +<%-- + Document : LoginCheck + Created on : Aug 22, 2021, 12:01:15 PM + Author : User +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + JSP Page + + + <% + String username=request.getParameter("username"); + String password=request.getParameter("password"); + + if((username.equals("admin") && password.equals("admin"))) + { + session.setAttribute("username",username); + response.sendRedirect("new1.jsp"); + } + else + { + request.setAttribute("errorMessage", "Invalid user or password"); + } + %> + + diff --git a/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/loginform.jsp b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/loginform.jsp index 7ec0dc0..8a6b39c 100644 --- a/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/loginform.jsp +++ b/CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/loginform.jsp @@ -44,6 +44,7 @@

Login

+
@@ -63,5 +64,6 @@
+