jsp在服务器端保存xml文件,急~~求助~
新手,刚接触xml,现在有个问题需要大家帮忙~~
项目要求需要修改服务器上的xml文件,现在已经在javascript中以xmlDoc.load()读出了xml文件中的内容,并在页面上对其内容进行了一些修改。xml文件是一些这样的信息:
<maxScale>4000 </maxScale>
<minScale>17000 </minScale>
<numZoomLevels>4 </numZoomLevels>
经过修改后现又保存在xmlDoc中,问题是如何将xmlDoc中的xml信息存入服务器上相应的xml文件中。在网上看了不少,感觉是要通过xmlhttp.Send(xmlDoc)将xmlDoc发送到服务器,然后在jsp中接收,并用xmlDoc.save进行存储,但试了很多一直调不通,希望高手能把这部分代码写下,还有需要用到什么头文件之类的东西也一并告知。
我自己写的代码:
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
xmlhttp.Open("post", "http://localhost:8088/geoserver/save.jsp", false);
xmlhttp.setRequestHeader("Content-Type","text/xml")
xmlhttp.Send(xmlDoc);
alert(“1”);
可以执行到alert(“1”);但是之后没有任何反应,既不跳转也没有保存...下面是接收的save.jsp,希望接收到xml信息后可以存到服务器上对应的xml文件中
<%
string xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.asy
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
一个JSP页面接收其他页面提交过来的FORM表单,但是要求只接收当前站点及其子站点提交过来的FORM表单,其他站点提交过来的表单不接收,这个怎么设置?
用过滤器
filter
将当前站点及其子站点放一个目录
然 ......
我JSP的页面是:
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......