???????ServletContext
????1?????????????Web??????????????????????????web????ServletContext????????????????Web??????????ServletContext????????????
????2?????÷?Χ??????Web??á?
????3???????
????a)????Servlet ??????
????this.getServletContext().getRequestDispatcher("/servlet/Demo10Servlet").forward(request?? response);
??????????н?????service????????????????з?????????????servlet??????request?????′?????????????request??????????????
????b)???????????
????1?????????·???????????java?????????????????????????д???·?????????????tomcat/bin???????????ò?????????
???????д??·??????????????????????????·???????
????2??????????????ServletContext?????
????this.getServletContext().getRealPath(“/1.properties”)??????????????????·???????????????????????μ????·????
????this.getServletContext().getResourceAsStream(“/1.properties”)????????????????·???????????????·????????
????3???????servlet????????????????ServletContext????????????????????????
????classLoader.getResourceAsStream(“../../1.properties”)??????????????????????????????????У??и???????????
?????????????????????????
????classLoader.getResource(“../1.properties”).getPath()????????????????·??????и???????????
????????Request ??
????1?????????????service ??????????????????????????service???????????????????request??????????
????2?????÷?Χ?????????????????????????????
????3???????  ?????????????й?????????????????Servlet ?д????????????Jsp?????????????????????Request???д??????
????????Session ??
????HttpSession ????????У???????????????????????б?????????????
????1????????????????ε??? request.getSession() ????????????????????????ж????session?????????????  ?д??????session???????
??????????????session??б?????????30?????????????????????session??
?????????????????????????й???????е????session???????????
???????????session????invalidate???? ??????????????session??
????????????????????????????Session???????ж????????????????????????????????session ??????????????
?????????session?????????????Session???????  ???JavaBean ??????session????????????Serializable ??Session????????????
????2?????÷?Χ????λ???
???????PageContext ??
????1???????????????JSP???????????????????????????
????2?????÷?Χ??????JSP??棬?????????????С???????
?????????
??????1?????????????????????????????????????
??????2??????????????е?????
????pageContext ????????????????????
????public java.lang.Object getAttribute(java.lang.String name??int scope)
????public void setAttribute(java.lang.String name?? java.lang.Object value??int scope)
????public void removeAttribute(java.lang.String name??int scope)
????pageContext ?д?????????
????PageContext.APPLICATION_SCOPE
????PageContext.SESSION_SCOPE
????PageContext.REQUEST_SCOPE
????PageContext.PAGE_SCOPE
????findAttribute?????????????????????????????????page??request??session??application??
??????С??????????????????????????????????????????ж???????????????null(??el????????????????null??????????????)
??????3??????????????      ??????????forward??include??????????????????????