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 6617307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:41:18+00:00 2026-05-25T20:41:18+00:00

I am having a strange issue with autocompleter in JSP when application is authenticated

  • 0

I am having a strange issue with autocompleter in JSP when application is authenticated through NTLM. After NTLM authentication code is passed and re-directed to JSP page, my autocompleter doesn’t work at all. I am using the following for autocompleter Ajax.Autocompleter("emp","autocomp","getajaxdata.jsp");
For reference

If I remove the NTLM authentication code from my application, then autocompleter would work.
How can I resolve this issue? Strangely this issue only occurs in IE, in firefox it works fine.

Any help is highly appreciable.

Regards

Code I used for NTLM authentication in servlet

 public void service(HttpServletRequest request, 
                        HttpServletResponse response) throws ServletException, IOException {response.setContentType(CONTENT_TYPE);
        /**
        * Coding to find out the current logged in user name
        **/
        String username="";
        String auth = request.getHeader("Authorization");
        if (auth == null)
        {
        response.setStatus(response.SC_UNAUTHORIZED);
        response.setHeader("WWW-Authenticate", "NTLM");
        response.flushBuffer();
        return;
        }
        if (auth.startsWith("NTLM "))
        {
        byte[] msg = new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5));
        int off = 0, length, offset;
        if (msg[8] == 1)
        {
        byte z = 0;
        byte[] msg1 = {(byte)'N', (byte)'T', (byte)'L', (byte)'M', (byte)'S', (byte)'S', (byte)'P',
        z,(byte)2, z, z, z, z, z, z, z,(byte)40, z, z, z,
        (byte)1, (byte)130, z, z,z, (byte)2, (byte)2,
        (byte)2, z, z, z, z, z, z, z, z, z, z, z, z};
        response.setHeader("WWW-Authenticate", "NTLM " +
        new sun.misc.BASE64Encoder().encodeBuffer(msg1).trim());
        response.sendError(response.SC_UNAUTHORIZED);
        return;
        }
        else if (msg[8] == 3)
        {
        off = 30;

        length = msg[off+9]*256 + msg[off+8];
        offset = msg[off+11]*256 + msg[off+10];
        username = new String(msg, offset, length);
        }
        }
        /**
         * Coding for removing extra white spaces from the user name
         */
        String windname="";
        String  windname1=username.replaceAll(" ",null  );
        int l=username.length();           
        int i=0;
        while (i<l)
        {
          if (username.charAt(i)==0)
          {
          }
          else
          {
              char temp=username.charAt(i);
              windname=windname+temp;
          }
          i++;
        }
  • 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-25T20:41:19+00:00Added an answer on May 25, 2026 at 8:41 pm

    I am having similar problems and I found this:

    posted with empty data (sporadical)

    If you do searching around… NTLM does some funny things:

    Some more info on NTLM

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

Sidebar

Related Questions

Having a strange issue with some C# code - the Getter method for a
I'm having a strange issue with cookie visibility between an authentication servlet and our
I'm having a strange issue here, i have this bit of code: <?php if
Having a very strange issue regarding postback in ASP.NET. I have page dynamically populating
I am currently having a strange issue with an application migrated from rails 2.3.8
I am having a strange issue associated with AsyncFileUpload control. after the upload, I
I am having a strange issue. I have a very simple piece of code
I am having a strange issue with output buffering in php. with this code
I'm having a strange issue with RedirectToAction in MVC 3.0. Here is the code
I am having a strange issue that I can't seem to resolve. Here is

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.