Java Web??????·??????С??
?????shuaicong ???????[ 2017/4/7 11:06:38 ] ????????WEB Java ???????????
????(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??ó????????????????????????檔
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11