-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme
More file actions
34 lines (33 loc) · 1.14 KB
/
readme
File metadata and controls
34 lines (33 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
try {
String title=request.getParameter("title");
String content=request.getParameter("content");
Note note=new Note(0, title, content,new Date());
Session s= (Session) FactoryProvider.getFactory().openSession();
Transaction tx = ((SharedSessionContract) s).beginTransaction();
((org.hibernate.Session) s).save(note);
tx.commit();
s.close();
response.setContentType("text/html");
PrintWriter out=response.getWriter();
out.println("<h1>Note Added Successfully<h1>" );
}
catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Served at: ").append(request.getContextPath());
}
@charset "UTF-8";
.body {
/*font-family: Arial, sans-serif;*/
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #dcdbdb;
}