본문 바로가기

개발하자/JSP&Servlet

getAttribute,getParameter

aa.jsp

==========================================================

<%@ page language="java" contentType="text/html; charset=EUC-KR"
 pageEncoding="EUC-KR"%>
 <%
 request.setAttribute("v1","aa");
 %>
 <body>
 <jsp:forward page="bb.jsp?v2=bb"></jsp:forward>
 </body>

 

 

또는

 

<%@ page language="java" contentType="text/html; charset=EUC-KR"
 pageEncoding="EUC-KR"%>
 <%
 request.setAttribute("v1","aa");
 %>
 <body>
 <jsp:forward page="bb.jsp?">
 <jsp:param value="bb" name="v2"/>
 </jsp:forward>
 </body>

 

 

bb.jsp

==============================================

<%@ page language="java" contentType="text/html; charset=EUC-KR"
 pageEncoding="EUC-KR"%>
<%=request.getAttribute("v1")%><hr>
<%=request.getParameter("v2")%>

 

'개발하자 > JSP&Servlet' 카테고리의 다른 글

getRealPath("/"),getContextPath()  (0) 2015.02.23
getInitParameterNames(),getInitParameter()  (0) 2015.02.23
request.getContextPath--절대경로  (0) 2015.02.23
FileReader ,FileWriter  (0) 2015.02.19
getRealPath  (0) 2015.02.19