Source code for /src/form_update.jsp.txt

//======================================================================//
// Author: Mark Qian <markqian@hotmail.com>                             //
// WWW: http://www.coolshare.com                                        //
// Copyright (c) 2006, Mark Qian                                        //
//                                                                      //
// You must contact Mark Qian to get a permission of use                //
// in case you want to make any use of the codes except viewing it     //
// on Mark's site.                                                      //
//======================================================================//


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.lang.StringBuffer"%>
<%@ page import="java.util.List" %>
<%@ page import="javax.servlet.http.Cookie" %>
<%@ page import="com.coolshare.remotescript.common.Util" %>

<%
  List resList = (List)request.getAttribute("res");
  String a = request.getParameter("a");
  String cId = request.getParameter("cId");
  String res = resList.toString();
  if (resList.size()>0) {
    res = res.substring(1, res.length()-1).trim();
  } else {
	res = "";
  }
  
if (a.equals("AJAX")) {
%>
<%=res%>
<%
} else if (a.equals("DS")) {
%>
var comm = cm.findCommunicator('<%=cId %>');
comm.res = unescape("<%=Util.doEncode(res)%>");
comm.process();
<%
} else if (a.equals("Iframe")) {
	%>
	<html>
	  <script>
	  function doOnload() {
	    try {
		  var comm = parent.cm.findCommunicator('<%=cId %>');
		  comm.res = unescape("<%=Util.doEncode(res)%>");
		  comm.process();
		} catch (e) {
		  var msg = e.description?e.description:e;
          alert(msg);
          if (msg=="Permission denied")
            alert("Sorry, I, the code from RemoteScript.com, can not close the progress dialog\nsince it is popped up codes from coolshare.com .");
        }
	  }
	</script>
	<Body onload="doOnload()">
	</Body>
	</html>
<%
}
else if (a.equals("Cookie")) {
  Cookie setCookie = new Cookie("RSLite", java.net.URLEncoder.encode(res));
  response.addCookie(setCookie);	
}
else if (a.equals("Frame")) {
	%>
	 <html>
  <script>
  function doOnload() {
    try {
	  var comm = top.main.cm.findCommunicator('<%=cId %>');
	  comm.res = unescape("<%=Util.doEncode(res)%>");
	  comm.process();
    } catch (e) {
       alert(e.description?e.description:e);
       alert("Sorry, I, the code from RemoteScript.com, can not close the progress dialog\nsince it is popped up codes from coolshare.com .");
    }
  }
</script>
<Body onload="doOnload()">
</Body>
</html>
<%
	}
%>