????(1) Web??????·???????????????
????????????????з????????μ???棬???1?????


?????1

????Eclipse?????????2?????


?????2

??????????????????????????????????£?
????1. web?????????http://localhost:8080/
????2. web??ó??????????http://localhost:8080/test/
????3.???????jsp">http://localhost:8080/test/articles/article1.jsp??http://localhost:8080/test/articles/article2.jsp ????????????
??????.????·?????????????????
??????TestURL.jsp????в?????????·??????????
????1. getRequestURI()
????2. getContextPath()
????3. getServletPath()
??????????3?????


?????3

??????.web.xml?е?·??
????Servlet ??? /xx ?е? “/” ?????? web ?????·????
?????????????????ó?????????е?web.xml??????????????web???????????????????“/”???????? web ?????·?????????????web???????
??????.???????????е?·??????
????1. ??????“/”????request.getRequestDispatcher("hello.jsp ").forward(request?? response) ??response.sendRedirect(" hello.jsp ") ???????????????login.jsp?????
????2. ???·???а???“/”(????????“/”???·???е?????“/”)
????a?? ???
??????request.getRequestDispatcher("/hello.jsp").forward(request?? response) ???????http://localhost:8080/test/ ???????hello.jsp?????
????b???????
??????response.sendRedirect("/hello.jsp")???????http://localhost:8080/ ???????hello.jsp???
??????.
?????? ?е?·??
????“/”??????? web ?????·??.??
??????????????????????κ?????????????? ???? / ????????????? web ?????·???? ?????? web ?????·????
??????.Page?????errorPage?????·??????
????errorPage??????????”/”??????????????????WEB??ó????????????????????????檔