맨밑 aaa,bbb,index만 할줄알아도 다아는거임 단축키 ctrl+f6
<a href = "http://daum.net">다음링크</a>
<a href = "aaa.jsp">aaa페이지로</a>
<a href = "Animal/bbb.jsp">Animal폴더 안의 bbb페이지로</a>
<a href = "../index.jsp">다시 index페이지로</a>
상위폴더로 하나 올라가서 다시 하위폴더를 찾게됨.
index
<a href = "aaa.jsp?nickname=정우현">aaa페이지로</a>
aaa
<%
String nickname = request.getParameter("nickname");
System.out.println(nickname);
%>
<%=nickname%>
index
<%
String color = "red";
%>
<a href = "aaa.jsp?color=<%=color%>">aaa페이지로</a>
aaa
<%
String color = request.getParameter("color");
System.out.println(color);
%>
<%=color%>
index
<a href = "aaa.jsp?salary=300">가나</a>
<%
String salary = "300";
%>
aaa
<%
String salary = request.getParameter("salary");
System.out.println(salary);
%>
<%=salary%>
index
1 2 3 4 5 6 7 8 | <body> <form action="aaa.jsp"> <!-- vlaue = 초기값잡아주기 --> 이름 : <input type = "text" name = "name" ><br> 월급 : <input type = "text" name = "salary"><br> <input type="submit"><br> </form> </body> | cs |
aaa
1 2 3 4 5 6 7 8 9 10 11 12 | <body> <% String name = request.getParameter("name"); String salary = request.getParameter("salary"); int num = Integer.parseInt(salary); int s = num*12; String ss=request.getParameter("s"); %> 이름 : <%=name %> 연봉 : <%=s %> <a href = "bbb.jsp?name=<%=name%>&salary=<%=salary%>&ss=<%=s%>">테이블로 보기</a> </body> | cs |
bbb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <body> <table border="1"> <tr> <th>이름</th> <th>월급</th> <th>연봉</th> </tr> <tr> <td>이름</td> <td>월급</td> <td>연봉</td> </tr> <tr> <td><%=request.getParameter("name")%></td> <td><%=request.getParameter("salary")%></td> <td><%=request.getParameter("ss")%></td> </tr> </table> </body> | cs |
728x90
댓글