Myeclipse+Ajax Àý×Ó
Ò»¸öMyEclipseÀïµÄAJAXÀý×Ó2008-03-19 19:53±¾Àý½«ÔÚÒ³ÃæµÄ²ÎÊýÒÔGetºÍPOSTÁ½ÖÖ·½Ê½´«µÝµ½·þÎñÆ÷£¬²¢»ØÏÔµ½Ò³Ã棻 ±¾Àý¹²°üÀ¨Á½¸öÖ÷ÒªÎļþgetAndPostExample.htmlºÍGetAndPostExample.javaÒÔ¼°Ò»¸öÅäÖÃÎļþweb.xml ½¨Á¢ÎļþµÄ²½Ö裺 1.ÔÚEclipseн¨Ò»¸öweb project-->ajax1 2.ÔÚajax1ÀïÃæÐ½¨Ò»¸ögetAndPostExample.html 3.ÔÚajax1ÀïÃæÐ½¨Ò»¸öservlet-->GetAndPostExample.java getAndPostExample.htmlÈçÏÂ
This is the description of my J2EE component This is the display name of my J2EE component GetAndPostExample com.ajax1.GetAndPostExample GetAndPostExample /GetAndPostExample index.jsp ÔÚÕâ¸ö¼òµ¥µÄAJAXµÄÀý×ÓÀïgetAndPostExaple.html¸ºÔð±íµ¥²ÎÊýµÄÊäÈëºÍ´«µÝ£¬¶øservlet GetAndPostExample.java¸ºÔðÔÚ·þÎñÆ÷¶Ë½ÓÊܲÎÊý¡£²ÎÊý´«µÝʱ¼ÓµÄʱ¼ä´ÁÊDZ£Ö¤URLµÄΨһÐÔ¡£
Ïà¹ØÎĵµ£º
oad()·½·¨
load( url [,data] [,callback]) dataÊÇObjectÀàÐÍ£¬·¢ËÍÖÁ·þÎñÆ÷µÄkey/valueÊý¾Ý
Àý£º
$(function(){
$("#send").click(function(){
$("#resText").load("test.html ......
×î½üÔÚÓÃAjax×öµÇ¼´°¿Ú£¬µ«ÊÇlogoutµÄʱºòÐèÒª¶Ôsession½øÐд¦Àí¡£ÓõÄÊÇsession.removeAttribute()º¯Êý½øÐÐlogout¡£µ«ÊÇ£¬ÊÂʵ֤Ã÷£¬ÔÚlogoutÒÔºó£¬ÔٴεǼµÄʱºò£¬²¢²»Äܵǽ³É¹¦£¬Ñ¹¸ù²»»á½øÈëactionÖ´ÐÐÏàÓ¦µÄ·½·¨£¨hqlÓï¾äҲûÓÐÖ´ÐУ©¡£
Ϊ´Ë£¬¾Ý˵ÓÐÁ½ÖÖ·½·¨½ ......
# app\controllers\examples_controller.rb
ruby ´úÂë
class ExamplesController < ApplicationController
def ajax_select
@items = %w{AA BB}
end   ......
Private static readonly object ReflectionLock = new object();
Lock (ReflectionLock)
{
Type scriptManagerType =
Type.GetType(
"System.Web.UI.ScriptManager, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35",
false);
......
ashxÎļþÊÇ.net 2.0мӵÄÎļþÀàÐÍ(ÆäʵÔÚ.net 1.0ÏÂÒѾ¿ÉÓÃ,µ«ÊÇûÓй«¿ªÌṩ).
ashxÎļþºÍaspxÎļþÓÐʲô²»Í¬? ÎÒÃÇÏÈн¨Ò»¸öashxÎļþ¿´¿´:
ashx
<%@ WebHandler Language="C#" Class="Handler" %>
using System;
using System.Web;
public class Handler : IHttpHandler {
public void Process ......