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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:45:19+00:00 2026-06-11T19:45:19+00:00

In one of my GWT-Platform application I am facing a weird issue, when I

  • 0

In one of my GWT-Platform application I am facing a weird issue, when I run application in jetty configured in eclipse GWT plugin and hit the browser refresh current page is loaded (placeManager.getCurrentPlaceRequest()) succesfully but when application war is deployed in tomcat/jboss execution stops after onBind() method of current place request’s presenter and doesn’t reveal page.

In the process of handling refresh, first time canReveal() method of GateKeeper for that Presenter returns false and after a server call I reveal current place again which causes canReveal() method to return true but the presenter is still unrevealed. So, here I suspect something is tricky!!

Any hint on such behavior?

Following is the code snippet for implemented LoggedInGatekeeper which playing a key role:


public class LoggedInGatekeeper implements Gatekeeper
{

private final EventBus eventBus;

private final DispatchAsync dispatcher;

private final PlaceManager placeManager;

private CurrentUser currentUser;

private boolean isUserLoggedOut;

private String lastPageAccessed;

@Inject
public LoggedInGatekeeper(final EventBus eventBus, final DispatchAsync dispatcher, final PlaceManager placeManager)
{
    this.eventBus = eventBus;

    this.dispatcher = dispatcher;

    this.placeManager = placeManager;

    this.eventBus.addHandler(LoginAuthenticatedEvent.getType(), new LoginAuthenticatedEventHandler()
    {
        @Override
        public void onLogin(LoginAuthenticatedEvent event)
        {
            currentUser = event.getCurrentUser();
            isUserLoggedOut = false;
        }
    });

    this.eventBus.addHandler(LogoutUserEvent.getType(), new LogoutUserEventHandler()
    {
        @Override
        public void onLogoutUser(LogoutUserEvent event)
        {
            SessionFactory.removeCookie(Constants.LAST_PAGE_ACCESSED);
            currentUser = null;
            isUserLoggedOut = true;
        }
    });
}

@Override
public boolean canReveal()
{
    Log.info("Browser fetched session cookie : " + Cookies.getCookie(Constants.JSESSION_COOKIE_KEY));

    if (Cookies.getCookie(Constants.JSESSION_COOKIE_KEY) == null)
    {
        SC.say("Your session is expired. Please login again");
        NavigateToLoginEvent.fire(eventBus);
        return false;
    }

    if (currentUser != null && !isUserLoggedOut)
    {

        lastPageAccessed = placeManager.getCurrentPlaceRequest().getNameToken();
        Log.info("canReveal() 1 : " + lastPageAccessed);
        SessionFactory.addCookie(Constants.LAST_PAGE_ACCESSED, lastPageAccessed);
        return currentUser.isLoggedIn();
    }
    else if (isUserLoggedOut)
    {
        Log.info("canReveal() 2 : User is logged out");
        NavigateToLoginEvent.fire(eventBus);
        return false;
    }
    else
    {
        Log.info("canReveal() 3 : Check on server for logged in user");
        dispatcher.execute(new FetchLoggedInUserAction(), new FetchLoggedInUserAsyncCallback());
        return true;
    }
}

class FetchLoggedInUserAsyncCallback extends MessageAsyncCallback<FetchLoggedInUserResult>
{
    /**
     * 
     */
    public FetchLoggedInUserAsyncCallback()
    {
        super("Loading...");
    }

    @Override
    public void doOnFailure(Throwable caught)
    {
        NavigateToLoginEvent.fire(eventBus);
    }

    @SuppressWarnings("unchecked")
    @Override
    public void doOnSuccess(FetchLoggedInUserResult result)
    {
        if (result == null)
        {
            Log.info("doOnSuccess() 1 : LoggedInUser not found on server");
            NavigateToLoginEvent.fire(eventBus);
        }
        else
        {
            Log.info("doOnSuccess() 2 : LoggedInUser found on server");
            if (result.getLoggedInUser() != null)
            {

                currentUser = new CurrentUser();
                currentUser.setMerchantConsoleUser(result.getLoggedInUser());

                SessionFactory.getClientSessionInstance().put(SessionKeys.LOGGED_IN_USER, result.getLoggedInUser());

                PlaceRequest currentPlaceRequest = placeManager.getCurrentPlaceRequest();

                Log.info("doOnSuccess() 3 : " + currentPlaceRequest.getNameToken());

                if (currentPlaceRequest != null)
                {   
                    placeManager.revealPlace(currentPlaceRequest);
                }
            }
            else
            {
                NavigateToLoginEvent.fire(eventBus);
            }
        }
    }
}

}

Thanks in Advance.

  • 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-11T19:45:21+00:00Added an answer on June 11, 2026 at 7:45 pm

    Mystery revealed, Added following code in onBind() method and browser refresh started working in all environment as intended. It seems like a fuzzy behavior of the framework where GateKeeper tries to fetch data from server at that time somehow presenter’s visibility is set to false and this same thought caused me to write following code and it worked, Hope someone from GWT-P can have look at this post to think of proper way to handle such scenario:

    /**
         * This piece of code takes care of revealing page on browser refresh event.
         * On browser refresh somehow visibility of page is set to false, so, we need to manually fire the reveal content event.
         */
        if(this.getProxy().canReveal() == true && !this.isVisible()){
                    revealInParent();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been building a GWT 1.7 + GAE application using the eclipse plugin. The
I have created one simple GWT application.I have created build.xml. But when I run
I have Application written with GWT 1.7. I have one page where I upload
When running a GWT application in hosted mode one usually needs to add the
One of the best features of gwt is the edit/save/refresh development cycle. This has
How do I pass a hidden field value from one application(html) page to GWT
I have created one GWT sample project for Web Application. I have also created
I'm trying to do one app with GWT that will run inside one iframe.
I am developing a GWT web application. I have a login page with one
I'm trying to import one of the GWT samples into Eclipse by following the

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.