Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7971177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:34:35+00:00 2026-06-04T07:34:35+00:00

I’m using ExtJS to perform an AJAX request. Here’s my code Ext.Ajax.request({ url: ‘TestServer’,

  • 0

I’m using ExtJS to perform an AJAX request. Here’s my code

Ext.Ajax.request({
    url: 'TestServer',
    method: 'PUT',
    params: {
        json: Ext.encode({
            name: 'dummy'
        })
    }
});

So I decided to get the request parameter from servlet. So I’ve used

request.getParameter("json")

But I get a null value instead. It works well when I used POST method, but not PUT. Is there any other way to get the request parameter in servlet while using PUT method?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:34:36+00:00Added an answer on June 4, 2026 at 7:34 am

    From the Ext.Ajax 4.1 Docs:

    method : String
    The default HTTP method to be used for requests. Note that this is case-sensitive and should be all caps (if not set but params are present will use “POST”, otherwise will use “GET”.)

    The documentation makes no mention of allowing PUT, but it also makes no mention of disallowing PUT.

    Additionally, there is documentation that explains how to use an HTTP Method Override to make the servlet invoke services mapped to PUT or DELETE.

    The fact that someone would suggest using an HTTP Method Override instead of simply directly using PUT or DELETE, coupled with the Ext.Ajax documentation omitting other HTTP Method options, strongly suggests that what you are trying to do is not possible using Ext.

    This seems odd, considering this is very possible with raw XmlHttpRequests and even jQuery AJAX.

    However, taking advantage of JavaScript’s dynamic-typing and functional characteristics, one can easily override/extend the default Ajax functionality with this code taken from this forum post:

       Ext.lib.Ajax.request = function(method, uri, cb, data, options) {
            if(options){
                var hs = options.headers;
                if(hs){
                    for(var h in hs){
                        if(hs.hasOwnProperty(h)){
                            this.initHeader(h, hs[h], false);
                        }
                    }
                }
                if(options.xmlData){
                    this.initHeader('Content-Type', 'text/xml', false);
                    method = (options.method == 'PUT' ? 'PUT' : 'POST');
                    data = options.xmlData;
                }else if(options.jsonData){
                    this.initHeader('Content-Type', 'text/javascript', false);
                    method = (options.method == 'PUT' ? 'PUT' : 'POST');
                    data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData;
                }
            }
    
            return this.asyncRequest(method, uri, cb, data);
        };
    
        // example request
        Ext.Ajax.request({
            url: 'testrest.php',
            method: 'PUT',
            headers: {'Content-Type': 'text/xml'},
            success: function(response, opts) { Ext.Msg.alert('Sucess', 'Update has been successful'); },
            xmlData: '<blah>de</blah>'
        });
    

    Lastly, it’s also not clear which version of Ext you’re using, and the code sample above is from 2007. You may need to modify your AJAX request so it uses jsonData (in place of their xmlData) instead of using params, as params doesn’t appear to be included in the override/extend operation. Furthermore, one of the posters in the forum mentioned that if params are present, POST is used by default, regardless of what is specified. Thus, this is another reason to consider using jsonData instead.

    If jsonData doesn’t meet your needs, then you could always follow the examples demonstrated by the authors of this code example and modify your copy of Ext.Ajax so that it includes “PUT” requests when params are submitted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.