开发者

jquery $.getJSON, retrieving servlet parameters upon process method

开发者 https://www.devze.com 2023-03-17 23:12 出处:网络
Is this the correct way to set parameters upon a servlet request (tags, tagmode, format)? $.getJSON(\'....Servlet\',

Is this the correct way to set parameters upon a servlet request (tags, tagmode, format)?

$.getJSON('....Servlet',
            {
              tags: "cat",
              tagmode: "any",
              format: "json"        
            }, function(data) {
});

And can I retrieve the parameters like this (Servlet class ext开发者_运维百科ending HttpServlet | inside process method)?

request.getParameter("tags");
request.getParameter("tagmode");
request.getParameter("format");

I haven't found the right terms to search google or stackoverflow. So if anyone has a proper answer or documentation to this issue, then just let me know.


Yes, that should be all correct. And BTW, you could have answered your own question if you had just written the code and tried it. ;o)

0

精彩评论

暂无评论...
验证码 换一张
取 消