Skip to content

Commit 35c7a9d

Browse files
committed
adding Source code + webContent
1 parent bf6aa93 commit 35c7a9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3621
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Class-Path:
3+
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
Deployment in PC to access same internet Connection
2+
====================================================
3+
4+
Step1: connect pc to internet
5+
Step2: CMD ---> ipconfig
6+
IPv4 Address. . . . . . . . . . . : 192.168.43.250
7+
8+
server running on PORT: 3030
9+
http://192.168.43.250:3030/ChatAppWithDataBase
10+
11+
12+
my_IP:: 192.168.43.250
13+
14+
15+
16+
welcomepage.jsp
17+
===============
18+
//from:: loginurl & registerurl
19+
request.getAttribute("jspResponseFor")
20+
request.getAttribute("result")
21+
request.getAttribute("email")
22+
23+
//from:: where Common logic used
24+
request.getAttribute("sessionTimeOut")
25+
26+
//from:: where Common logic used & loginurl
27+
session.getAttribute("userLogin")
28+
29+
//from:: loginurl
30+
session.getAttribute("email")
31+
session.getAttribute("ChatApp-userName")
32+
33+
//from:: loginUserMsg & registerUserMsg
34+
request.getAttribute("myResponse")
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
showSavedChaturl
45+
=================
46+
ses.getAttribute("anotherUser");
47+
48+
req.setAttribute("chat", chat);//PersistentData
49+
50+
51+
52+
53+
54+
55+
56+
57+
storeChaturl
58+
=============
59+
ses.getAttribute("anotherUser");
60+
req.getParameter("message");
61+
62+
req.setAttribute("msgInsertResult", msgInsertResult);
63+
64+
//if msg in not valid as per business rules then
65+
forward(chatWindowMain.jsp)
66+
//else
67+
include(chatWindowMain.jsp)
68+
69+
70+
71+
72+
73+
74+
75+
chatWindowMain.jsp
76+
===================
77+
http://localhost:3030/ChatAppWithDataBase/chatWindowMain.jsp?user=user2%40gmail.com
78+
<%
79+
// Some Logic if User Sends Msg (becuse at that time page"chatWindowMain.jsp" will reload through Form)
80+
81+
session.setAttribute("anotherUser",request.getParameter("user"));
82+
83+
out.println(session.getAttribute("anotherUser"));
84+
%>
85+
86+
87+
88+
89+
UserLogOut (userLogOut.jsp)
90+
==========
91+
92+
ses.getAttribute("userLogin");//flag
93+
ses.getAttribute("email");//email
94+
ses.getAttribute("ChatApp-userName");//userName extract from email
95+
96+
session.invalidate();
97+
request.setAttribute("sessionTimeOut", "logOut");
98+
99+
forward("welcomepage.jsp")
100+
101+
102+
103+
104+
105+
DashBoard
106+
==========
107+
108+
ses.getAttribute("userLogin");//flag
109+
ses.getAttribute("email");//email
110+
ses.getAttribute("ChatApp-userName");//userName extract from email
111+
112+
request.setAttribute("sessionTimeOut", "true"); [Conditions Apply]
113+
forward(welcomepage.jsp)
114+
115+
116+
include(listuserurl)
117+
request.getAttribute("listOfuser")
118+
119+
120+
121+
122+
123+
124+
125+
126+
127+
128+
Login
129+
======
130+
131+
req.getParameter("email");
132+
req.getParameter("password");
133+
134+
ses.setAttribute("userLogin","true");//flag
135+
ses.setAttribute("email",email);//email
136+
ses.setAttribute("ChatApp-userName", userName));//userName extract from email
137+
138+
req.setAttribute("result", result);//persistentResult
139+
req.setAttribute("email", email);
140+
req.setAttribute("jspResponseFor", "LoginServlet");
141+
142+
include(welcomepage.jsp)
143+
printWriter.close
144+
145+
146+
147+
148+
149+
150+
151+
152+
153+
Registration
154+
=============
155+
156+
req.getParameter("email");
157+
req.getParameter("password");
158+
159+
request.getAttri("result", result);//persistableResult
160+
request.getAttri("email", email);
161+
request.getAttri("jspResponseFor", "RegisterServlet");
162+
163+
include(registerUserMsg.jsp)
164+
165+
request.setAttribute("myResponse", myResponse);
166+
167+
printWriter.close
168+
169+
registerUserMsg.jsp
170+
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
CURRENT_TIMESTAMP
2+
3+
INSERT INTO `CHATAPP_LOGIN` (`EMAIL`, `PASSWORD`, `TIME_STAMP`) VALUES ('[email protected]', 'user1@123', sysdate);
4+
5+
GMT+5:30
6+
7+
SELECT CONVERT_TZ(CURRENT_TIMESTAMP,'GMT','IST');
8+
9+
SELECT CONVERT_TZ(CURRENT_TIMESTAMP,'GMT','+5:30') from dual;
10+
11+
12+
SELECT CONVERT_TZ('2004-01-01 12:00:00','+00:00','+10:00')
13+
SELECT CONVERT_TZ('2021-05-08 4:54:00','+00:00','+05:30')
14+
15+
16+
SELECT DATE_FORMAT(CURRENT_TIMESTAMP, '%Y-%m-%d %h:%i:%s');
17+
18+
19+
TimeStamp[IST](remoteMySQL)::
20+
==============================
21+
SELECT CONVERT_TZ(DATE_FORMAT(CURRENT_TIMESTAMP, '%Y-%m-%d %h:%i:%s'),'+00:00','+05:30');
22+
23+
24+
25+
26+
27+
28+
29+
30+
//************************** SQL QUERY ****************************************
31+
32+
33+
34+
35+
36+
#ChatAppLoginDAO
37+
private static final String NEW_USER_INSERT_QUERY = "INSERT INTO CHATAPP_LOGIN (EMAIL, PASSWORD, TIME_STAMP) VALUES(?,?,sysdate)";
38+
private static final String USER_LOGIN_SELECT_QUERY = "SELECT EMAIL, PASSWORD FROM CHATAPP_LOGIN WHERE EMAIL = ?";
39+
40+
41+
#ListAllRegisteredUserServlet
42+
private static final String SELECT_ALL_USER_QUERY = "SELECT EMAIL FROM CHATAPP_LOGIN";
43+
44+
45+
#ShowSavedChatServlet
46+
private static final String SELECT_USERS_CHAT_QUERY = "select messages, to_char(time_stamp, 'dd-mon-yyyy hh24:mi:ss') as time_stamp, msg_from, msg_to from chatapp_chat where msg_from IN (?, ?) AND msg_to IN (?, ?) ORDER by time_stamp ASC";
47+
48+
49+
#StoreChatServlet
50+
private static final String STORE_USERS_CHAT_QUERY = "INSERT INTO \"ADV_JAVA\".\"CHATAPP_CHAT\" (MESSAGES, time_stamp, MSG_FROM, MSG_TO) VALUES (?, sysdate, ?, ?)";
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
62+
63+
64+
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<!-- Developed by Devesh Pandey :: For more Info send Mail:: [email protected] -->
6+
<meta charset="UTF-8">
7+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
8+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
9+
<link rel = "icon" href = "img/logo.jfif" type = "image/x-icon">
10+
<link rel="stylesheet" href="/css/chatWindows.css">
11+
<title>ChatWindow</title>
12+
</head>
13+
14+
<body style="background-color: #070e1b;width: 400px;">
15+
16+
<!-- ################################# Iformation About Developing Team ###################-->
17+
18+
<!-- Developed by Devesh Pandey :: For more Info send Mail:: [email protected] -->
19+
<!-- GitHub:: https://github.com/dvspandey -->
20+
<!-- Linkdin:: https://www.linkedin.com/in/dvspandey -->
21+
22+
<!-- ################################# Iformation About Developing Team End ###################-->
23+
24+
25+
26+
27+
<!-- *************************************** Profile ***************************************-->
28+
<div class="profile">
29+
<div class="users">
30+
<div class="user">
31+
<!-- //https://www.toptal.com/designers/htmlarrows/symbols/ -->
32+
<span class="face">&#9786;</span>
33+
<span class="name">[email protected]</span>
34+
<span class="name" style="color: snow;">YOU</span>
35+
</div>
36+
<div class="signs">
37+
<span class="sign">&#9886;</span>
38+
<span class="sign" style="color: yellow;">&#9993;</span>
39+
<span class="sign">&#9887;</span>
40+
</div>
41+
<div class="user">
42+
<span class="face">&#9786;</span>
43+
<span class="name">[email protected]</span>
44+
<span class="name" style="color: snow;">FRIEND</span>
45+
</div>
46+
</div>
47+
</div>
48+
<!-- *************************************** Profile End ***************************************-->
49+
50+
51+
52+
53+
<!-- ************************* Navigation Buttons End *************************************** -->
54+
<div class="linkButton">
55+
<a href="" style="text-decoration: none; color: cornsilk;" >DashBoard</a>
56+
<a href="" style="text-decoration: none; color: cornsilk;" >LogOut</a>
57+
</div>
58+
<!-- ************************* Navigation Buttons End *************************************** -->
59+
60+
61+
62+
63+
64+
<div class="vl">
65+
<!-- *************************************** Iframe ***************************************-->
66+
<iframe src="messagesScreen.html"> </iframe>
67+
<!-- *************************************** Iframe End ***************************************-->
68+
</div>
69+
70+
71+
72+
<!-- *************************************** Form ***************************************-->
73+
<div class="form">
74+
<form action="savechat.net" method="POST">
75+
<!-- NOTE:: do not make textBox Auto Focus otherwise autoScroll of iframe Not work for New Message-->
76+
<input type="text" name="message" id="" autocomplete="off" class="textBox">
77+
<input type="submit" value="SEND" class="submitButton">
78+
</form>
79+
</div>
80+
<!-- *************************************** Form end ***************************************-->
81+
82+
<div class="vl" style="left:99%"></div>
83+
84+
</body>
85+
86+
</html>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>Document</title>
8+
9+
<style>
10+
.autoScrollDown {
11+
outline: none;
12+
background-color: #030133;
13+
color: cornsilk;
14+
padding: 0px;
15+
border-style: solid;
16+
border-color: cornsilk;
17+
border-left: none;
18+
border-top: none;
19+
border-right: none;
20+
max-width: 1rem;
21+
max-height: 2rem;
22+
}
23+
24+
</style>
25+
26+
</head>
27+
<body>
28+
<input type="text" autocomplete="off" autofocus class="autoScrollDown">
29+
</body>
30+
</html>

0 commit comments

Comments
 (0)