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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:09:21+00:00 2026-05-15T03:09:21+00:00

We have a gwt app that uses jcifs to pull the user name from

  • 0

We have a gwt app that uses jcifs to pull the user name from our NT domain. Here is a clip of our web.xml:

<filter>
    <filter-name>NtlmHttpFilter</filter-name>
    <filter-class>com.xxx.gwt.server.MyNTLMFilter</filter-class>

    <init-param>
        <param-name>jcifs.netbios.wins</param-name>
        <param-value>192.168.109.20</param-value>
    </init-param>
    <init-param>
        <param-name>jcifs.smb.client.domain</param-name>
        <param-value>its</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>NtlmHttpFilter</filter-name>
    <url-pattern>/trunkui/greet</url-pattern>
</filter-mapping>

<!-- Servlets -->
<servlet>
    <servlet-name>greetServlet</servlet-name>
    <servlet-class>com.xxx.gwt.server.GreetingServiceImpl</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>greetServlet</servlet-name>
    <url-pattern>/trunkui/greet</url-pattern>
</servlet-mapping>

So currently when the user goes to our site they get about 2 or 3 repeated prompts asking them to log onto the domain even though they already are (you have to be on the domain to get to our app). I would like to at least reduce the prompting to only happen once. So I was going to make a dummy servlet off of “/trunkui/dummy” and let that get called only when I ask for the name. The remote servlet has this method that we call asynchronously:

public String getUser() {
    String userAgent = "";
    try {
        userAgent = getThreadLocalRequest().getUserPrincipal().getName();

        int slashIdx = -1;
        if ((slashIdx = userAgent.indexOf('\\')) >= 0)
            userAgent = userAgent.substring(slashIdx + 1);
    } catch (Exception npe) {
        npe.printStackTrace();
    }
    return userAgent;
}

So I wanted to do some sort of call to the dummy servlet to do the domain prompting, but I am unsure on how to do this from the gwt remote service. Or if there is a better way to do this?

  • 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-15T03:09:22+00:00Added an answer on May 15, 2026 at 3:09 am

    I figured it out. I built the dummy servlet and then used a RequestBuilder on the client side to do a get on that servlet. That servlet then gets the userprincipal. Here is the client side:

        RequestBuilder getNameRB = new RequestBuilder(RequestBuilder.GET,  "naming");
        getNameRB.setCallback( new RequestCallback() {
    
            @Override
            public void onResponseReceived(Request request, Response response) {
                loadUserName(response.getText());
            }
    
            @Override
            public void onError(Request request, Throwable exception) {
                Window.alert("Unable to authenticate user\n"+exception.getMessage());
                Window.Location.replace("http://ccc");
            }
        });
        try {
            getNameRB.send();
        } catch (RequestException e) {
            Window.alert(e.getMessage());
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gwt project that uses gwt-mosaic. Here is the error message I
I have a newly coded GWT/GAE app that uses RequestFactory and Editors on the
I'm implementing a web app, which uses sessions. I'm using GWT and app engine
We have a very large GWT project that results in a monolithic app about
I have a new web app that is packaged as a WAR as part
I have a web app that has to do something every, let's say first
I was looking into GWT. It seems nice, but our software have the must
I am building a facebook platform web app using GWT and hosting it on
I am trying to write an application that uses java.net.Socket. I have also written
I've got an app written with Struts/Tiles/JSP that I'm adding a GWT app to.

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.