github.com/ismailbayram/bigpicture@v0.0.0-20231225173155-e4b21f5efcff/internal/browser/javaproject/src/main/com/shashi/servlets/UserHome.java (about) 1 package com.shashi.servlets; 2 3 import java.io.IOException; 4 import java.io.PrintWriter; 5 6 import javax.servlet.RequestDispatcher; 7 import javax.servlet.ServletException; 8 import javax.servlet.annotation.WebServlet; 9 import javax.servlet.http.HttpServlet; 10 import javax.servlet.http.HttpServletRequest; 11 import javax.servlet.http.HttpServletResponse; 12 13 import com.shashi.constant.UserRole; 14 import com.shashi.utility.TrainUtil; 15 16 @SuppressWarnings("serial") 17 @WebServlet("/userhome") 18 public class UserHome extends HttpServlet { 19 protected void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { 20 res.setContentType("text/html"); 21 PrintWriter pw = res.getWriter(); 22 TrainUtil.validateUserAuthorization(req, UserRole.CUSTOMER); 23 RequestDispatcher rd = req.getRequestDispatcher("UserHome.html"); 24 rd.include(req, res); 25 pw.println("<div class='tab'>" + " <p1 class='menu'>" + " Hello " + TrainUtil.getCurrentUserName(req) 26 + " ! Welcome to our new NITRTC Website" + " </p1>" + " </div>"); 27 pw.println("<div class='main'><p1 class='menu'>User Home</p1></div>"); 28 pw.println("<div class='tab'>Hello " + TrainUtil.getCurrentUserName(req) 29 + " ! Good to See You here.<br/> Here you can Check up the train " 30 + "details, train schedule, fare Enquiry and many more information.<br/>Just go to the Side Menu Links and " 31 + "Explore the Advantages.<br/><br/>Thanks For Being Connected with us!" + "</div>"); 32 33 } 34 35 }