github.com/ismailbayram/bigpicture@v0.0.0-20231225173155-e4b21f5efcff/internal/browser/javaproject/src/main/com/shashi/servlets/BookTrainFwd.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("/booktrainfwd")
    16  public class BookTrainFwd extends HttpServlet {
    17  	/**
    18  	 * 
    19  	 */
    20  	private static final long serialVersionUID = 1L;
    21  
    22  	public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
    23  		res.setContentType("text/html");
    24  		TrainUtil.validateUserAuthorization(req, UserRole.CUSTOMER);
    25  		
    26  		RequestDispatcher rd = req.getRequestDispatcher("BookTrains.html");
    27  		rd.forward(req, res);
    28  
    29  	}
    30  
    31  }