Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ▪️Test07Servlet.java
- import java.io.IOException;
- import javax.servlet.ServletException;
- import javax.servlet.annotation.WebServlet;
- import javax.servlet.http.HttpServlet;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- @WebServlet("/Test07Servlet")
- public class Test07Servlet extends HttpServlet {
- private static final long serialVersionUID = 1L;
- public Test07Servlet() {
- super();
- }
- protected void doGet(HttpServletRequest request, HttpServletResponse response)
- throws ServletException, IOException {
- response.sendRedirect("/WEB-INF/Test07Jsp.jsp");
- }
- }
- ▪️Test07Jsp.jsp
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset=UTF-8">
- <title>リダイレクトテスト</title>
- <h2>リダイレクトされたページです</h2>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment