guokehua(@yahoo.com.cn oy Java 1010 附8 Servlet2 2008-3-10 郭克华EE框架实战教学视频
2008-3-10 1 oy Java! J guokehua@yahoo.com.cn 郭克华J2EE框架实战教学视频 附8Servlet2 Servlet2
guokehua(@yahoo.com.cn PY高级内容1:在 Servlet内实现跳转协作) ·表单提交给 Servlet,-转到另一个页面 RequestDispatcher接口获 1010 1:getServlet Context( getReques dIspatcher(string) 重要方法 forword 或者使用 response. sendRedirect(String) ·两者区别 008-3-10 郭克华J2EE框架实战教学视频
2008-3-10 2 oy Java! J guokehua@yahoo.com.cn 郭克华J2EE框架实战教学视频 高级内容1:在Servlet Servlet内实现跳转(协作) • 表单提交给Servlet Servlet,跳转到另一个页面 跳转到另一个页面 • RequestDispatcher RequestDispatcher接口 获 得:getServletContext getServletContext().getReques getReques tDispatcher tDispatcher(String) (String) • 重要方法:forword forword • 或者使用 response. response.sendRedirect sendRedirect(String) (String) • 两者区别
guokehua(@yahoo.com.cn PY高级内容2:在Sere内实现包含(协作) · RequestDispatcher接口获 f:getServletContext(. getReques I dIspatcher(String) 重要方法nc|ude 008-3-10 郭克华J2EE框架实战教学视频
2008-3-10 3 oy Java! J guokehua@yahoo.com.cn 郭克华J2EE框架实战教学视频 高级内容2:在Servlet Servlet内实现包含(协作) • RequestDispatcher RequestDispatcher接口 获 得:getServletContext getServletContext().getReques getReques tDispatcher tDispatcher(String) (String) • 重要方法:include include
guokehua(@yahoo.com.cn Ya高级内容3:读取 web xm内的参数 Kcontext-param> < param-name>参数名</ parain-name> 1010 <param-value></param-value> </context-param> 读取全局参数 getservletContext(). getInitParam eter(参数名〃) 读取局部参数 getinitParameter(参数名") 008-3-10 郭克华J2E框架实战教学视频
2008-3-10 4 oy Java! J guokehua@yahoo.com.cn 郭克华J2EE框架实战教学视频 高级内容3:读取web.xml内的参数 <context context-param> <param-name>参数名</param-name> <param-value>值</param-value> </context context-param> 读取全局参数 getServletContext getServletContext().getInitParam getInitParam eter(“参数名”) 读取局部参数 getInitParameter getInitParameter(“参数名”)
guokehua(@yahoo.com.cn pYo高级内容4:设置欢迎页面 <welcome-file-list> <welcome 1010 file>MyJsp jsp</welcome-file> </welcome-file-list> 008-3-10 郭克华J2EE框架实战教学视频
2008-3-10 5 oy Java! J guokehua@yahoo.com.cn 郭克华J2EE框架实战教学视频 高级内容4:设置欢迎页面 :设置欢迎页面 • <welcome welcome-file-list> • <welcome welcomefile>MyJsp.jsp</welcome welcome-file> • </welcome welcome-file-list>