๊ธฐ๋ณธ๊ฐ์ฒด(request.out)

3258 ๋‹จ์–ด parameterparameter

5๋‹จ ๊ณฑ์…ˆ์„ ๋งŒ๋“ค์–ด๋ด์š”~

localhost/project1/t1.jsp?n=5

<table>
<%
for(int n = 1 ; n<10; n++){
	 out.print("<tr>");
   	 out.print("<td>"+5+"*"+n+"="+(5*n)+"</td><br/>");
         out.print("</tr>");
}
%>
</table>

URL์— ๋‚ ์•„์˜จ parameter๋ฅผ ๋ฐ›์•„์š”

localhost:8282/project1/t1.jsp?a=100&b=200
์ด๋ผ๊ณ  ๋‚ ๋ ธ์–ด์š”~

<%=request.getParameter("a")%><br/> //100
<%=request.getParameter("b")%><br/> //200

localhost:8282/project1/t1.jsp?์ด๋ฆ„=๊ฐ’&์ด๋ฆ„=๊ฐ’


"์–˜๋ฅผ ์ฟผ๋ฆฌ๋ฌธ์ž์—ด~ ์ด๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค / ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์‹œ๊ฐ„๋•Œ ๋ฐฐ์šด ์ฟผ๋ฆฌ๋ฌธ๊ณผ๋Š” ๋‹ค๋ฆ…๋‹ˆ๋‹ค"

url =localhost:8282/project1/t1.jsp?dan=5
	<% String str = request.getParameter("dan");
			int dan = Integer.parseInt(str);
      		        for(int n=1 ; n<10 ; n++){
                        out.print("<tr>");
                        out.print("<td>"+dan+"*"+n+"="+(dan*n)+"</td>");
                        out.print("</tr>");
         					  }
        %>//5 ๋‹จ์ถœ๋ ฅ

out, request ํ†ฐ์บฃ์—”์ง„์ด ์•Œ๊ณ  ์žˆ๋Š” ๊ฐ์ฒด -> built in Object ๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค(๋‚ด์žฅ๊ฐ์ฒด)

url =localhost:8282/project1/t1.jsp?id=aa&pw=11
ID: <%=request.getParameter("id")%>
PW: <%=request.getParameter("pw")%>

์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ