`
lerous
  • 浏览: 66864 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

AjaxAnyWhere的"content-type in not text/xml"错误

阅读更多
今天在使用AjaxAnyWhere完成局部刷新时遇到一个错误,
alert出来的具体错误是:AjaxAnywhere error :content-type in not text/xml :[],到google上一搜,说报这类错误的是不少,但似乎没看到几个说清楚其原因的,于是就自己一步一步查,发现我的是一个参数的问题,
action中的一行代码:
request.setAttribute("holdon", request.getParameter("holdon"));
跟踪发现request.getParameter("holdon").equals("null") == true,原来传到此方法的时候查询字符串中 有 holdon = null,但方法中request.getParameter("holdon")的时候转成了字符串,于是上面的代码就成了
request.setAttribute("holdon", "null");
再回到页面就报错了(我的页面有把个判断,是把holdon转成整形的,然后进行判断)~~

这个问题的原因应该是经过action的方法后返回页面刷新时,页面出现了错误,不能正常显示(刷新),当然具体错误各异。
  • 大小: 11.7 KB
1
0
分享到:
评论

相关推荐

    JSP/XML中的contextType大全

    同样,在处理XML数据时,可以设置`Content-Type`为`application/xml`或`text/xml`。 ### 4. `Content-Type`与AJAX 在AJAX(Asynchronous JavaScript and XML)请求中,`Content-Type`主要用于指定发送到服务器的...

    cxf.xml,cxf-servlet.xml,cxf-extension-soap.xml

    <import resource="classpath:META-INF/cxf/cxf.xml"/> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/> <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

    php中header设置常见文件类型的content-type

    在PHP中可以通过header函数来发送头信息,还可以设置文件的...header('Content-type: application/atom+xml'); //CSS header('Content-type: text/css'); //Javascript header('Content-type: text/javascript'); /

    调用pb开发的webserver(HTTP POST)

    Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <short xmlns="http://webi.org">short</short>*/ //出参是json格式{"statusCode":"2"}

    文件下载及web文件的contentType类型大全

    本文将详细介绍如何实现文件下载功能以及不同文件类型的`Content-Type`设置。 #### 一、文件下载的基本实现 文件下载的核心在于通过HTTP响应将文件内容发送给客户端,并且通过设置特定的HTTP头部来告诉浏览器应该...

    jsoup jar包

    <parser content-type="text/html" class="com.opensymphony.module.sitemesh.parser.HTMLPageParser" /> <parser content-type="text/html;charset=ISO-8859-1" class=...

    springmodules-cache.xsd&springmodules-ehcache.xsd.rar

    cvc-complex-type.2.4.a: Invalid content was found starting with element 'page-encoding'. One of '{"http:// java.sun.com/xml/ns/javaee":include-prelude, ...

    常见的四种POST 提交数据方式(小总结)

    Content-Type设置为`application/xml`或`text/xml`,消息主体是XML文档。例如:`<form><title>test</title><sub><item>1</item><item>2</item><item>3</item></sub></form>`。服务器端需要支持XML解析。 每种提交...

    PHP 使用header函数设置HTTP头的示例解析 表头

     //Atom header(‘Content-type: application/atom+xml’); //CSS header(‘Content-type: text/css’); //Javascript header(‘Content-type: text/javascript’); //JPEG Image header(‘Content-type: ...

    content-type:创建和解析HTTP Content-Type标头

    $ npm install content-type API var contentType = require ( 'content-type' ) contentType.parse(字符串) var obj = contentType . parse ( 'image/svg+xml; charset=utf-8' ) 解析Content-Type标头。 这将...

    HTTP_Status_404的几种解决方案

    解决方法:如果你的Web应用程序有多个jsp页面的话,当你点击你Web应用程序的虚拟根目录时可能会出现404错误,只是你只需要修改Tomcat服务器中web.xml中的配置信息。例如,修改<init-param>中的<param-name>listings...

    spring-boot-soap-webservice-sample:使用 spring-boot 的 SOAP 网络服务示例

    SOAP 网络服务: 先决条件: jdk 6 或更高版本 ... 获取客户预订: curl --header "content-type: text/xml" -d @requestRetrieveCustomerBookings.xml 搜索客户预订: curl --header "content-type: te

    ajax+php--接收处理xml和text格式数据

    header('Content-Type: text/plain'); echo $response; ?> ``` 总结,这个例子展示了如何使用AJAX与PHP结合,实现客户端发送XML或Text数据,服务器端接收并处理,然后再返回响应数据的过程。这为创建实时、高效的...

    tomcat解决跨域访问问题配置

    1、修改tomcat下的Conf/web.xml文件,在该文件内容中新增以下配置,注意,若该web.xml中存在其它filter,则需要将该filter放在所有filter前面; <filter-name>CorsFilter</filter-name> <filter-class>org....

    tomcat跨域请求配置

    <param-value>Accept, Origin, X-Requested-With, Content-Type, Last-Modified</param-value> </init-param> <init-param> <param-name>cors.exposedHeaders</param-name> <param-value>Set-Cookie</param-...

    ajaxAnywhere配置

    - **错误处理**:如遇到类似“返回类型不是text/xml”的错误,检查是否所有需要AjaxAnywhere功能的请求都已正确配置到Filter中。 #### 三、实践中的挑战与建议 - **常见问题**:根据实践经验,当连续点击某些功能...

    ie浏览器不能下载.sisx文件,而是直接打开

    <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type> </mime-mapping> ``` - JAR文件: ```xml <mime-mapping> <extension>jar</extension> <mime-type>application/java-archive</mime-type> </mime...

    Pass4side IBM 000-289 考题

    选项A通过将Content-Type设置为`text/xml`,使得服务器能够识别请求体中的数据为XML格式,从而可以正确地应用样式策略规则。而其他选项均不符合这一要求,因此不是正确答案。 ### 题目二 **题目背景**: 一家公司...

    AndroidSDK下/platform-tools/api/annotations.zip

    编译时遇到以下报错:app:...java.io.IOException: Could not parse XML from annotations/android/widget/annotations.xml 请将本文件替换SDK目录下的/platform-tools/api/annotations.zip文件,建议替换前备份原文件

Global site tag (gtag.js) - Google Analytics