国产在线传媒,91精彩视频在线播放,在线观看h网址http://www.aygfsteel.com/jiabao/category/30911.html機會只會給垂青有準備的人,運氣不是每個人都有的.zh-cnSat, 19 Apr 2008 14:20:07 GMTSat, 19 Apr 2008 14:20:07 GMT60Servlet使用http://www.aygfsteel.com/jiabao/archive/2008/04/19/194225.html金家寶金家寶Sat, 19 Apr 2008 12:31:00 GMThttp://www.aygfsteel.com/jiabao/archive/2008/04/19/194225.htmlhttp://www.aygfsteel.com/jiabao/comments/194225.htmlhttp://www.aygfsteel.com/jiabao/archive/2008/04/19/194225.html#Feedback0http://www.aygfsteel.com/jiabao/comments/commentRss/194225.htmlhttp://www.aygfsteel.com/jiabao/services/trackbacks/194225.html
1.1重定向(如果對方不支持cookie,回寫sessionID進行session跟蹤)
?response.sendRedirect(response.encodeRedirectURL(request.getContextPath()+"/next"));
******************************************************************
1.2轉發
?RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url);
?dispatcher.forward(request,response);
******************************************************************
1.3字符
??request.setCharacterEncoding("utf-8");
??response.setContentType("text/html;charset=utf-8");
******************************************************************
String servletPath = request.getServletPath();
??servletPath = servletPath.substring(servletPath.lastIndexOf("/") + 1);
??String operation = servletPath.substring(0, servletPath.indexOf(".do"));
1.設置連接超時時間(分鐘)
?<session-config>
??<session-timeout>50</session-timeout>
?</session-config>
******************************************************************
4.相對路徑匹配
?1>絕對匹配?/xx/yy
?2>后綴匹配?*.xx
?3>后面匹配?/xx/*
******************************************************************
5.監聽器
5.1ServletRequestListener
???getServletContext()
???getServletRequest()
?requestDestroyed(ServletRequestEvent)
?requestInitialized(ServletRequestEvent)
5.2HttpSessionListener
???getSession()
?sessionCreated(HttpSessionEvent)
?sessionDestroyed(HttpSessionEvent)
5.3ServletContextListener
???getServletContext()
?contextInitialized(ServletContextEvent)
?contextDestroyed(ServletContextEvent)
?
5.4ServletRequestAttributeListener
???getName()
???getValue()
?attributeAdded(ServletRequestAttributeEvent)
?attributeRemoved(ServletRequestAttributeEvent)
?attributeReplaced(ServletRequestAttributeEvent)
5.5HttpSessionAttributeListener
???getName()
???getValue()
???getSession()
?attributeAdded(HttpSessionBindingEvent)
?attributeRemoved(HttpSessionBindingEvent)
?attributeReplaced(HttpSessionBindingEvent)
5.6ServletContextAttributeListener
???getName()
???getValue()
?attributeAdded(ServletContextAttributeEvent)
?attributeRemoved(ServletContextAttributeEvent)
?attributeReplaced(ServletContextAttributeEvent)


金家寶 2008-04-19 20:31 發表評論
]]>
主站蜘蛛池模板: 扬中市| 温宿县| 东乡县| 敦化市| 英德市| 屏东市| 安庆市| 怀化市| 策勒县| 图们市| 库尔勒市| 弥渡县| 蓬溪县| 西峡县| 湘潭市| 东安县| 秦皇岛市| 离岛区| 灵川县| 庆安县| 玛曲县| 宁德市| 温泉县| 河南省| 屏东县| 赣州市| 芦山县| 大埔区| 阿拉善左旗| 柏乡县| 绥化市| 桂阳县| 吉木乃县| 锡林浩特市| 台前县| 五河县| 大连市| 邯郸县| 鄯善县| 定边县| 正安县|