Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added first webApp #71

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CL-BSCSD-22-45/Danuka/Project1/build/built-jar.properties
Original file line number Diff line number Diff line change
@@ -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=
Binary file not shown.
19 changes: 19 additions & 0 deletions CL-BSCSD-22-45/Danuka/webapp1/nb-configuration.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>Tomcat</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
</properties>
</project-shared-configuration>
76 changes: 76 additions & 0 deletions CL-BSCSD-22-45/Danuka/webapp1/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.mycompany</groupId>
<artifactId>webapp1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>webapp1</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
30 changes: 30 additions & 0 deletions CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/LoginCheck.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<%--
Document : LoginCheck
Created on : Aug 22, 2021, 12:01:15 PM
Author : User
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
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");
}
%>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context path=""/>
69 changes: 69 additions & 0 deletions CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/loginform.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<%--
Document : loginform
Created on : Aug 18, 2021, 11:32:36 PM
Author : User
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<style>

button {
background-color: #4CAF50;
width: 30%;
color: black;
padding: 15px;
margin: 10px 0px;
border: none;
cursor: pointer;
margin-left: 70px;
}

form {
border: 3px solid #f1f1f1;
}

input[type=text], input[type=password] {
width: 30%;
margin: 8px 0;
padding: 12px 20px;
display: inline-block;
border: 2px solid green;
box-sizing: border-box;
}

.text1{
margin-left: 85px;

</style>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Login</h1>
<form action="LoginCheck.jsp" method="post">
<form>
<div class="container">
<label>Username : </label>
<input type="text" placeholder="Enter Username" name="username" required><br>
<label>Password : </label>
<input type="password" placeholder="Enter Password" name="password" required><br>
<button type="submit">Login</button><br>
<button type="button" class="cancelbtn"> Cancel</button><br>

<input class="text1" type="checkbox" checked="checked"> Remember me
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Forgot <a href="#"> password? </a>


</div>
</form>

</body>
</html>
49 changes: 49 additions & 0 deletions CL-BSCSD-22-45/Danuka/webapp1/src/main/webapp/new1.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<%--
Document : new1
Created on : Aug 8, 2021, 8:15:22 PM
Author : User
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<style>
th {
font-size: 25px
}
p{text-align: center;}

</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>

<h1>Details Table</h1>
<table width = "700px" border = "3px" >

<<tr style="height:40px">
<th>Name</th>
<th>Age</th>
<th>Address</th>
</tr>
<<tr>
<td><p>Charles</p></td>
<td><p>54</p></td>
<td><p>Califonia</p></td>
</tr>
<<tr>
<td><p>Dasun</p></td>
<td><p>26</p></td>
<td><p>Colombo</p></td>
</tr>
<<tr>
<td><p>Nuwan</p></td>
<td><p>30</p></td>
<td><p>Kandy</p></td>
</tr>
</table>
</body>
</html>