StackOverFlow
StackOverFlow

Reputation: 4614

Redirecting to GWT Custom page from application link(other App)

Redirecting application link to Java - GWT Custom page.

Whenever user will login through my APP. and user hit button(say add record) then redirection should happen i.e. page should redirected to GWT custom page from application link.

Hidden fields available on UI Screen which is developed in GI . These fields can be passed to GWT custom applications launched from the application link.

APP(UI) --> SERVLET---> GWT page(UI with data present in request i.e jsessionid,hidden fields)

what changes need to do in web.xml ?

Plz provide any helpful document,link,sample code and any idea

Hope for the best co-operation Thanks in advance.

Upvotes: 0

Views: 2399

Answers (1)

Peter Knego
Peter Knego

Reputation: 80340

Do you already have a fixed login page (servlet) tah you must use? Then do this:

  1. Window.Location.assign(loginUrl) will take you to a new page. Your GWT app will be "closed" and all state will be lost.

  2. Your login servlet should redirect back to your GWT page when done. Usually this is done by supplying a URL parameter when invoking login page - check the login servlet. Usually something like http://yourserver.com/login?returnTo=GwtAppUrl.

    At this point your user is logged in, which means that servlet has set a session cookie. From this point on (until logout or session time-out) your GWT and GWT-RPC will use this session automatically (browser sends session cookie) - you don't have to do anything.

  3. You can pass some data back to GWT by fragment identifier http://yourserver.com/login?returnTo=GwtAppUrl#somePage/parameter1/parameter2. However better option is to just use GWT-RPC to get the data from server.

Otherwise, if you are making everything from scracth, you can use GWT do do the login: How to implement a login page in a GWT app?

Upvotes: 2

Related Questions