github.com/ismailbayram/bigpicture@v0.0.0-20231225173155-e4b21f5efcff/internal/browser/javaproject/src/main/com/shashi/servlets/AdminCancleTrainFwd.java (about) 1 package com.shashi.servlets; 2 3 import java.io.IOException; 4 5 import javax.servlet.RequestDispatcher; 6 import javax.servlet.ServletException; 7 import javax.servlet.annotation.WebServlet; 8 import javax.servlet.http.HttpServlet; 9 import javax.servlet.http.HttpServletRequest; 10 import javax.servlet.http.HttpServletResponse; 11 12 import com.shashi.constant.UserRole; 13 import com.shashi.utility.TrainUtil; 14 15 @WebServlet("/cancletrainfwd") 16 public class AdminCancleTrainFwd extends HttpServlet { 17 /** 18 * 19 */ 20 private static final long serialVersionUID = 1L; 21 22 /** 23 * 24 * @param req 25 * @param res 26 * @throws IOException 27 * @throws ServletException 28 */ 29 protected void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { 30 res.setContentType("text/html"); 31 TrainUtil.validateUserAuthorization(req, UserRole.ADMIN); 32 RequestDispatcher rd = req.getRequestDispatcher("CancleTrain.html"); 33 rd.forward(req, res); 34 35 } 36 37 }