Multipage gwt app

46 views
Skip to first unread message

Deepak Singh

unread,
Nov 17, 2011, 11:32:08 AM11/17/11
to google-we...@googlegroups.com
Hi All,

With new GWT 2.4 eclipse plugin,

I created a new project. It comes with the project architecture as usual,

client
      GreetingService
      GreetingServiceAsync
      Project.java
Project.gwt.xml

Server
    GreetingServiceImpl

war
   project.html / css


Now right click on project, click on Google web toolkit -> GWT module

It creates a new module named Module2 with an entry point. So it has client, server, Module2.gwt.xml and Module2.html
Thus GWT allows to create more than one html page in the same application.

Now i can do anything in module2 very well in its project architechture.

Now the problem comes when i need to open Module2.html in a new window after the user clicks an event in Project.html. I need to access the data from Project package to Module2 package in both server and client. But it then creates a problem.

My requirement is to transfer the session from Project.html to Module2.html as well as Module2 should be able to access data from server/client package of Project.

Can anyone pls suggest me the best approach.


--
Deepak Singh

Deepak Singh

unread,
Nov 17, 2011, 2:08:23 PM11/17/11
to google-we...@googlegroups.com
Some suggestion pls..
--
Deepak Singh

-sowdri-

unread,
Nov 18, 2011, 1:05:50 AM11/18/11
to google-we...@googlegroups.com
You can have as many modules as you want for the same client/server code. And you can reuse the same services across modules. 

Just understand that you create multiple module definitions (.gwt.xml file) and a corresponding host pages for each of them. 

And if you want to pass data/info across module, pass it as url parameter. 

If you are using Activities/Places, then the parsing will take place in the PlaceTokenizer for the DefaultActivity. 

Hope this helps,
-sowdri-

Deepak Singh

unread,
Nov 18, 2011, 9:31:03 AM11/18/11
to google-we...@googlegroups.com
Thanks for input.

I need to know how to make a rpc call from module2 to module1. I have server class running in module1 and i have to invoke the methods in module1 from client of module2.

how to acheive this?

Also, i need to check that same session flows from host page of module1 to host page of module2 when i open  module2 host page in a new window.

Thanks
Deepak

-sowdri-

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/k1skH_FXGSwJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh

-sowdri-

unread,
Nov 19, 2011, 4:38:05 AM11/19/11
to google-we...@googlegroups.com
>> I need to know how to make a rpc call from module2 to module1. I have server class running in module1 and i have to invoke the methods in module1 from client of module2.

In GWT each module could define the client and server packages that must include. In your case, make sure you include the packages(in particular classes) containing the service you wish to call in both the modules in both the gwt.xml files. In this case you can call the services as usual. 

Remember, inclusion of a class/package in one module does not prevent you from including the same class/packages in any number of other modules. 

Regarding session management, that depends on how and who is managing the sessions for you.

Thanks,

Deepak Singh

unread,
Nov 19, 2011, 5:07:03 AM11/19/11
to google-we...@googlegroups.com
>>  make sure you include the packages(in particular classes) containing the service you wish to call in both the modules in both the gwt.xml files. In this case you can call the services as usual. 

Got it. But to include theses packages in module2 using module2.gwt.xml ?

Thanks
Deepak

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh
Reply all
Reply to author
Forward
0 new messages