Maya1991

Untitled

Feb 11th, 2016
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1.  
  2. ▪️Test07Servlet.java
  3. import java.io.IOException;
  4. import javax.servlet.ServletException;
  5. import javax.servlet.annotation.WebServlet;
  6. import javax.servlet.http.HttpServlet;
  7. import javax.servlet.http.HttpServletRequest;
  8. import javax.servlet.http.HttpServletResponse;
  9.  
  10. @WebServlet("/Test07Servlet")
  11. public class Test07Servlet extends HttpServlet {
  12.     private static final long serialVersionUID = 1L;
  13.  
  14.     public Test07Servlet() {
  15.         super();
  16.     }
  17.  
  18.     protected void doGet(HttpServletRequest request, HttpServletResponse response)
  19.             throws ServletException, IOException {
  20.         response.sendRedirect("/WEB-INF/Test07Jsp.jsp");
  21.     }
  22.  
  23. }
  24.  
  25. ▪️Test07Jsp.jsp
  26. <%@ page language="java" contentType="text/html; charset=UTF-8"
  27.     pageEncoding="UTF-8"%>
  28. <!DOCTYPE html>
  29. <html>
  30. <head>
  31. <meta charset=UTF-8">
  32. <title>リダイレクトテスト</title>
  33. <h2>リダイレクトされたページです</h2>
  34. </head>
  35. <body>
  36.  
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment