jspForm.jsp
资源名称:arcims.rar [点击查看]
上传用户:gzuoyue
上传日期:2022-07-08
资源大小:177k
文件大小:2k
源码类别:
GIS编程
开发平台:
ASP/ASPX
- <%@ page language="java" buffer="8kb" %>
- <%@ page import="com.esri.aims.mtier.io.ConnectionProxy" %>
- <html>
- <head>
- <title>JSP Form</title>
- <%
- /**
- * Creates a new instance of The AppServerLink Object.
- */
- ConnectionProxy mcp = new ConnectionProxy();
- String arcxmlRequest = request.getParameter("ArcXMLRequest"); //ArcXML request to be sent
- String jsFunction = request.getParameter("JavaScriptFunction");
- String serverName = request.getParameter("ServerName");
- String serviceName = request.getParameter("ServiceName");
- String connectType = request.getParameter("ConnectType");
- if (connectType==null) connectType = "tcp";
- String theResponse = "";
- String httpURL = "";
- out.println("<script language='JavaScript' type='text/javascript'>");
- out.println(" function passXML() {");
- out.println(" // ArcXML Response packaged here.");
- if (arcxmlRequest != null) {
- if (connectType.equals("tcp")) {
- mcp.setConnectionType(ConnectionProxy.TCP);
- mcp.setPort(5300);
- mcp.setHost(serverName);
- } else if (connectType.equals("https")) {
- if (serverName.indexOf("http")==-1) {
- httpURL = "https://" + serverName;
- }
- mcp.setConnectionType(ConnectionProxy.HTTP);
- mcp.setUrl(new java.net.URL(httpURL));
- } else {
- if (serverName.indexOf("http")==-1) {
- httpURL = "http://" + serverName;
- }
- mcp.setConnectionType(ConnectionProxy.HTTP);
- mcp.setUrl(new java.net.URL(httpURL));
- }
- mcp.setService(serviceName);
- theResponse = mcp.send(arcxmlRequest);
- //out.println(theResponse);
- out.println(" var f = document.forms[0];");
- out.println(" var xmlResponse = f.ArcXMLResponse.value;");
- out.println(" " + jsFunction + "(xmlResponse);");
- out.println(" return true;");
- }
- out.println(" }");
- out.println(" var connectType='" + connectType + "';");
- out.println("</script>");
- %>
- </HEAD>
- <BODY BGCOLOR="#000000" TEXT="#000000" onload="passXML()">
- <h3>Response Form</h3>
- <P>
- <FORM ACTION="jspForm.jsp" METHOD="POST" name="theForm">
- <INPUT TYPE="Hidden" NAME="ArcXMLRequest" VALUE="">
- <INPUT TYPE="Hidden" NAME="JavaScriptFunction" VALUE="parent.MapFrame.processXML">
- <INPUT TYPE="Hidden" NAME="ServerName" VALUE="">
- <INPUT TYPE="Hidden" NAME="ServiceName" VALUE="">
- <INPUT TYPE="Hidden" NAME="ConnectType" VALUE="tcp">
- <P>
- ArcXML Response:<BR>
- <textarea name="ArcXMLResponse">
- <%
- if (arcxmlRequest != null) {
- out.println(theResponse);
- }
- %>
- </textarea>
- </FORM>
- </BODY>
- </HTML>