1.데이터를 포함하지 않는 경우
:jsp ,서블릿 모두
response.sendRedirect("예시.jsp");
2.데이터를 포함하는 경우
- JSP로 구현할 경우
<%
request.setAttritude("예시1",m);
pageContext.forwared("예시2.jsp");
%>
- 서블릿으로 구현할 경우
예시(..){
request.setAttritude("예시1",m);
RequestDispatcher dispatcher = request.getRequestDispatcher("예시2.jsp");
dispatcher.forward(request,response);
}'servlet' 카테고리의 다른 글
| HttpServletRequest (0) | 2023.11.09 |
|---|---|
| getParameter <-- 값을 가져올때 (0) | 2023.10.28 |
| POST방식의 인코딩과 디코딩 (0) | 2023.10.28 |
| 캐시 삭제 (0) | 2023.10.27 |
| service() (0) | 2023.10.27 |