-
Notifications
You must be signed in to change notification settings - Fork 977
Expand file tree
/
Copy pathBaseController.java
More file actions
96 lines (83 loc) · 3.59 KB
/
Copy pathBaseController.java
File metadata and controls
96 lines (83 loc) · 3.59 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*package org.pk.resume.builder.controller;
import java.io.IOException;
import javax.servlet.http.*;
import org.pk.resume.builder.beans.Achievements;
import org.pk.resume.builder.beans.Book;
import org.pk.resume.builder.beans.Conference;
import org.pk.resume.builder.beans.Education;
import org.pk.resume.builder.beans.Experience;
import org.pk.resume.builder.beans.ExpertActivities;
import org.pk.resume.builder.beans.Journal;
import org.pk.resume.builder.beans.Membership;
import org.pk.resume.builder.beans.Participation;
import org.pk.resume.builder.beans.Personal;
import org.pk.resume.builder.beans.Projects;
import org.pk.resume.builder.beans.References;
import org.pk.resume.builder.constants.GlobalConstants;
import org.pk.resume.builder.dao.UserService;
public class BaseController extends HttpServlet {
private static final long serialVersionUID = 4481510681863866579L;
private UserService userServices = new UserService();
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) {
String action = request.getParameter("action");
doPostAction(action, request, response);
}
public void doPostAction(String action, HttpServletRequest request,
HttpServletResponse response) {
try {
if(action.equals("resume"))
{
HttpSession session = request.getSession();
Personal personal = (Personal) session.getAttribute(GlobalConstants.PERSONAL_DETAILS);
Education education = (Education) session.getAttribute(GlobalConstants.EDUCATIONAL_DETAILS);
Experience experience = (Experience) session.getAttribute(GlobalConstants.EXPERIENCE_DETAILS);
Journal journal=(Journal)session.getAttribute(GlobalConstants.JOURNAL_DETAILS);
Conference conference=(Conference)session.getAttribute(GlobalConstants.CONFERENCE_DETAILS);
Book book=(Book)session.getAttribute(GlobalConstants.BOOK_DETAILS);
Participation part = (Participation) session.getAttribute(GlobalConstants.PARTICIPATION_DETAILS);
Membership member = (Membership) session.getAttribute(GlobalConstants.MEMBERSHIP_DETAILS);
ExpertActivities expAct = (ExpertActivities) session.getAttribute(GlobalConstants.EXPERT_ACTIVITY);
Achievements achieve = (Achievements) session.getAttribute(GlobalConstants.ACHIEVEMENTS_DETAILS);
Projects project = (Projects) session.getAttribute(GlobalConstants.PROJRCT_DETAILS);
References ref = (References) session.getAttribute(GlobalConstants.REFERENCES_DETAILS);
boolean p = userServices.insertPersonalDetails(personal);
//GlobalConstants.JSP_PAGE = "Final.jsp";
/*if(userServices.insertPersonalDetails(personal))
{
GlobalConstants.MESSAGE = "Personal Details Inserted Successfully";
if(userServices.insertEducationalDetails(education))
{
GlobalConstants.MESSAGE = "Educational Details Inserted Successfully";
if(userServices.insertExperienceDetails(experience))
{
GlobalConstants.MESSAGE = "Experience Details Inserted Successfully";
session.setAttribute(GlobalConstants.PERSONAL_DETAILS, null);
session.setAttribute(GlobalConstants.EDUCATIONAL_DETAILS, null);
session.setAttribute(GlobalConstants.EXPERIENCE_DETAILS, null);
}
else
{
GlobalConstants.MESSAGE = "Error in Experience Details Insertion";
}
}
else
{
GlobalConstants.MESSAGE = "Error in Educational Details Insertion";
}
}
else
{
GlobalConstants.MESSAGE = "Error in Personal Details Insertion";
}
response.sendRedirect(GlobalConstants.JSP_PAGE);
}
else
{
response.sendRedirect("index.jsp");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}*/