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

  • SEARCH
  • Home
  • 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 4620486
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:34:01+00:00 2026-05-22T02:34:01+00:00

How to get the data from ajax request in servlet page. Here I’m calling

  • 0

How to get the data from ajax request in servlet page. Here I’m calling the servlet by $.ajax.

var dataRequestObject= {}; 
                dataRequestObject= {Username:uname,Password:pword,Domain:domain,WindowsUser:windowsuser};

var dataRequestHeader= {}; 
                dataRequestHeader= {Username:uname,Password:pword,Domain:domain,WindowsUser:windowsuser};


    $.ajax({
            type:'POST',
            url:'http://localhost:8090/SampleServlet1/serv', //calling servlet      
            cache:false,
            header:dataRequestHeader,
            data:dataRequestObject,
            success:function(){ alert("Request Done");},
            error:function(xhr,ajaxOptions){
                alert(xhr.status + " :: " + xhr.statusText);
                } 
            });

I need those data and header in setvlet page.

  • 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-05-22T02:34:01+00:00Added an answer on May 22, 2026 at 2:34 am

    First, the header option is invalid. It needs to be headers. See also the jQuery.ajax() documentation.

    You can get the individual request headers by their name using HttpServletRequest#getHeader().

    String headerUsername = request.getHeader("Username");
    String headerPassword = request.getHeader("Password");
    String headerDomain = request.getHeader("Domain");
    String headerWindowsUser = request.getHeader("WindowsUser");
    // ...
    

    You can get the individual request parameters by their name using HttpServletRequest#getParameter().

    String paramUsername = request.getParameter("Username");
    String paramPassword = request.getParameter("Password");
    String paramDomain = request.getParameter("Domain");
    String paramWindowsUser = request.getParameter("WindowsUser");
    // ...
    

    I however wonder how useful it is to duplicate the data over headers and parameters…

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

Sidebar

Related Questions

On my page I'm making ajax-request to get data from server. The data is
How can i get the data from a AJAX request saved in a variable
I'm trying to make an ajax-request to vimeo to get data from an vimeo
I've written a little Ajax-y page, that displays data rows from an ajax request.
I have a website where an ajax call will get some Json data from
How to get data from the velocity page in a action class?
When looking to get data from a web page whats the recommended method if
My jQuery code (using ajax) request's data from a local php script (pgiproxy.php). This
A function uses the jquery.ajax() method to get data from server and use it
My problem: I am sending a request to a servlet from an AJAX function

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.