github.com/ismailbayram/bigpicture@v0.0.0-20231225173155-e4b21f5efcff/internal/browser/javaproject/src/main/com/shashi/servlets/AddTrainFwd.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 @SuppressWarnings("serial") 16 @WebServlet("/addtrainfwd") 17 public class AddTrainFwd extends HttpServlet { 18 19 /** 20 * 21 * @param req 22 * @param res 23 * @throws IOException 24 * @throws ServletException 25 */ 26 protected void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { 27 res.setContentType("text/html"); 28 TrainUtil.validateUserAuthorization(req, UserRole.ADMIN); 29 RequestDispatcher rd = req.getRequestDispatcher("AddTrains.html"); 30 rd.forward(req, res); 31 32 } 33 34 }