3
import java.io.IOException;
4
import java.io.PrintWriter;
6
import javax.servlet.RequestDispatcher;
7
import javax.servlet.ServletException;
8
import javax.servlet.http.HttpServlet;
9
import javax.servlet.http.HttpServletRequest;
10
import javax.servlet.http.HttpServletResponse;
12
import com.bittercode.model.UserRole;
13
import com.bittercode.util.StoreUtil;
15
public class AboutServlet extends HttpServlet {
17
public void service(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
18
PrintWriter pw = res.getWriter();
19
res.setContentType("text/html");
20
if (StoreUtil.isLoggedIn(UserRole.CUSTOMER, req.getSession())) {
21
RequestDispatcher rd = req.getRequestDispatcher("CustomerHome.html");
23
StoreUtil.setActiveTab(pw, "about");
24
pw.println("<iframe src=\"https://flowcv.me/shashirajraja\" class=\"holds-the-iframe\"\r\n"
25
+ " title=\"My Personal Website\" width=\"100%\" height=\"100%\"></iframe>");
27
} else if (StoreUtil.isLoggedIn(UserRole.SELLER, req.getSession())) {
28
RequestDispatcher rd = req.getRequestDispatcher("SellerHome.html");
30
StoreUtil.setActiveTab(pw, "about");
31
pw.println("<iframe src=\"https://flowcv.me/shashirajraja\" class=\"holds-the-iframe\"\r\n"
32
+ " title=\"My Personal Website\" width=\"100%\" height=\"100%\"></iframe>");
35
RequestDispatcher rd = req.getRequestDispatcher("login.html");
37
pw.println("<table class=\"tab\"><tr><td>Please Login First to Continue!!</td></tr></table>");