18 lines
546 B
Java
18 lines
546 B
Java
package com.baeldung.spring.servlets;
|
|
|
|
import javax.servlet.ServletException;
|
|
import javax.servlet.annotation.WebServlet;
|
|
import javax.servlet.http.HttpServlet;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.io.IOException;
|
|
|
|
@WebServlet("/welcome")
|
|
public class WelcomeServlet extends HttpServlet {
|
|
|
|
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
|
resp.sendRedirect(req.getContextPath() + "/redirected");
|
|
}
|
|
|
|
}
|