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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:37:26+00:00 2026-06-09T14:37:26+00:00

My Gin-injected GWT application uses RequestFactory together with Activities and Places. To tokenize RequestFactory’s

  • 0

My Gin-injected GWT application uses RequestFactory together with Activities and Places.

To tokenize RequestFactory’s stableId() inside Places, I inject the RequestFactory. That gives the class access to getProxyId(token) and getHistoryToken(stableId). The Tokenizer calls non-static, protected methods to tokenize a particular Place.

Here is a sample class.

public class StableIdPlace extends Place {

  @Inject private static Provider<StableIdPlace> provider;

  private final MyRequestFactory requestFactory;
  private EntityProxyId<StableIdProxy> stableId;

  @Inject
  public StableIdPlace(MyRequestFactory rf) {
    requestFactory = rf;
  }

  public void setStableId(EntityProxyId<StableIdProxy> which) {
    stableId = which;
  }

  public EntityProxyId<StableIdProxy> getStableId() {
    return stableId;
  }

  protected void setFromHistoryToken(String token) {
    stableId = requestFactory.getProxyId(token);
  }

  protected String getHistoryToken() {
    return requestFactory.getHistoryToken(stableId);
  }

  public static class Tokenizer implements PlaceTokenizer<StableIdPlace> {
    @Override
    public String getToken(StableIdPlace place) {
      return place.getHistoryToken();
    }
    @Override
    public StableIdPlace getPlace(String token) {
      StableIdPlace place = provider.get();
      place.setFromHistoryToken(token);
      return place;
  }
}

The strategy requires injecting a Provider wherever a new Place is needed. Unfortunately, that includes the static Tokenizers.

I tried to initiate the static injection (for each Place class) with requestStaticInjection() in the Gin client module. What I have works—except for History. I cannot get the static Provider to initialize. It causes a Null exception in the Tokenizer.

Is there a better way to do this? Thank you for your pointers.

  • 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-09T14:37:27+00:00Added an answer on June 9, 2026 at 2:37 pm

    You can use a PlaceHistoryMapperWithFactory to create tokenizer instances out of a Ginjector, Provider or AssistedInject factory.

    (I’d rather inject the RF into the tokenizer than the place, the place is about the proxy, the tokenizer about the history token)

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

Sidebar

Related Questions

I'm writing a rather simple application that uses GWT, Hibernate and Google Guice (with
I have a GWT MVP application using Activities and Places. This is inspired by
I have one application that contains sub-applications. I would like to segregate the GIN
I'm trying to build and GWT MVP application using Guice and Gin. I added
Could you guys help me marry GIN and custom bean validator in GWT application
The gin tutorial seems to imply that to inject remote services all you need
I'm using Gin 1.5 and GWT 2.4 The project built just fine before I
I'm using successfully GIN on my GWT projet. Now my RPC service will need
am creating an lo-gin application where am going to make the password as pixels
We are evaluating using GIN in out GWT project and have had good results

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.