`
lerous
  • 浏览: 66483 次
  • 性别: 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

    header('Content-Type: text/xml'); ``` 10. ZIP文件:对应MIME类型是"application/zip"。示例如下: ```php header('Content-Type: application/zip'); ``` 除了设置Content-Type,header函数还常用于进行...

    web.xml中的mime-type标签作用与使用

    ### Web.xml中的MIME-Type标签作用与使用详解 在Java Web开发中,`web.xml`配置文件扮演着至关重要的角色。它定义了Web应用程序的基本结构和行为,包括Servlet的映射、过滤器、监听器等配置。其中,`mime-mapping`...

    ContentType大全

    - `text/xml` 或 `application/xml`:XML文档 - `application/xhtml+xml`:XHTML文档 在ASP.NET中,可以通过`Response.ContentType`属性来设置页面的`ContentType`,就像示例代码所示: ```asp ...

    http中content-type头值-1

    下面将详细阐述`Content-Type`头值的常见类型及其用途。 1. **文本类型**: - `text/plain`: 这是最基础的类型,表示纯文本,如`.txt`文件。 - `text/html`: 表示HTML文档,是网页的主要格式。 - `text/css`: ...

    调用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...

    cvc-complex-type.2.4.d: Invalid content was found

    在XML Schema设计中,"cvc-complex-type.2.4.d: Invalid content was found" 是一个常见的错误信息,这通常意味着在解析XML文档时,遇到了不符合定义的复杂类型的内容。这个错误通常涉及到XML Schema的约束规则,即...

    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-...

Global site tag (gtag.js) - Google Analytics