DWR ·´×ªAJAX µ¥Ï߳̿ØÖÆSESSION
Ä¿µÄ£ºÍ¨¹ýÒ»¸öỊ̈߳¬ÅжÏSESSIONÊÇ·ñ¹ýÆÚ£¬Èç¹û¹ýÆÚ£¬µ÷Óÿͻ§¶ËÒ³ÃæµÄJS£¬°ÑÐÅÏ¢ÍƸø¿Í»§¶Ë¡£
ÎÒÃÇÒªÈÃDWR³ÌÐòÖ§³Ö·´ÏòAJAX¡£ÐèÒªÔÚweb.xmlÖÐDWRServletÀïÌí¼ÓÒ»¸ö³õʼ»¯²ÎÊý£¬ÁíÍâÒªÅäÖÃÒ»¸ö¼àÌýÆ÷£¬ÔÚÊʺϵÄʱºò¹Ø±ÕÏ̡߳£
ÈçÏÂÊÇweb.xmlÖеÄÅäÖÃ
<listener>
<listener-class>
org.directwebremoting.servlet.EfficientShutdownServletContextAttributeListener
</listener-class>
</listener>
<listener>
<listener-class>org.directwebremoting.servlet.EfficientShutdownServletContextListener</listener-class>
</listener>
<listener>
<listener-class>CheckSessionDwrServletContextListener</listener-class>
</listener>
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<!--¼¤»îÂÖѯºÍComet¹¦ÄÜ-->
<init-param>
<param-name>activeReverseAjaxEnabled</param-name>
<param-value>true</param-value>
</init-param>
<!-- ³ÌÐò¿ªÊ¼Ê±³õʼ»¯Rever
Ïà¹ØÎĵµ£º
ÔÚÒѾ·¢²¼µÄ ASP.NET2.0 ÖУ¬ÎÞË¢ÐÂÒ³Ã濪·¢Ïà¹Ø²¿·Öͬ beta2 Óв»ÉٸĶ¯¡£¶øÇÒÔÚÔ½À´Ô½¶àµÄ Ajax ¿ª·¢°ü±»¿ª·¢³öÀ´µÄÇé¿öÏ£¬ ASP.NET2.0 ×Ô´øµÄÎÞË¢ÐÂÒ³Ãæ¼¼ÊõûÓб»ºÜ¶àÈËÁ˽⣬ÉõÖÁ²»ÉÙÈËÈÏΪ¸Ã¹¦ÄÜÓÐЩ“¼¦Àß”¡£µ«Èç¹ûÎÒÃǽö½öÊÇÔÚ³ÌÐòÖмÓÈëºÜÉÙ²¿·ÖµÄ Ajax ÌØÐÔ£¬ Atlas ¡¢ Ajax.Net µÈ¾ÍÏÔµÃÓÐЩ&ldq ......
upload.jsp
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP ''upload.jsp'' starting page</title>
&n ......
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>xmlhttprequest ajax demo</title>
<script type ="text/javascript" language ="javascript" >
......
function ajaxFunction()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ajaxµ¯³öʾÀý-¿É¿ ......