Actually, you can, but you'll have to compile them both first.

To clarify what I mean...if I do this:

mvn clean
mvn gwt:run -DrunTarget=package.namespace.App1/App1.html

Then try to switch URL to App2, it will fail b/c that is not compiled yet.

but if I do this:

mvn clean
mvn gwt:compile
mvn gwt:run -DrunTarget=package.namespace.App1/App1.html

I should be able to switch URLS between the two apps in hosted mode.  It is
possible, you just have to make sure all apps are compiled.


On Fri, Oct 16, 2009 at 2:10 PM, Romeo Sanchez <romeo.sanc...@gmail.com>wrote:

> Yes, this is what I want to do. I was hoping we could do it directly from
> hosted mode.
>
> I do not know if I understood well, but what you are basically saying is
> that We can not run an application/project that involves multiple modules,
> each one having a different entrypoint in hosted mode? Did I parse correctly
> what you said?
>
> Thanks for clarifying.
>
> RSN.
>
> On Thu, Oct 15, 2009 at 8:38 PM, Davis Ford 
> <davisf...@zenoconsulting.biz>wrote:
>
>> Hi, I'm not sure you can do this in hosted mode, but I had a similar
>> situation that I solved, and now it is a set and forget.
>>
>> To be up front -- I am a maven bigot.  I think Ant is fine if it is done
>> right, but maven makes my life so much easier that I use it for all new
>> projects.
>>
>> That said, I had to develop an app that would have several different
>> "features" depending on the user/role -- significantly the login would
>> define that (and the role), but the login page was also different for each
>> user role.  I also wanted to share a lot of the code between these different
>> apps for obvious reasons.
>>
>> I could have made multiple maven projects and made re-usable components to
>> inherit and share the code that way -- but this would mean several different
>> projects, and the maintenance, overhead, headache of dealing with all that.
>> My needs were simpler.  I wanted all the code in one project...but I wanted
>> different entry points.  Really, the only thing that was different was the
>> entry point that bootstrapped the code specific for that app.  I separated
>> it out via URL, so you can hit:
>>
>> http://localhost/app1
>>
>> or
>>
>> http://localhost/app2
>>
>> So, in the end my project uses multiple modules and URL filtering to
>> control access to a particular app.  The only real downside is that it takes
>> longer to compile when I deploy, but that is no big deal for me.  I can't
>> run hosted mode in parallel like you are asking for, but hosted mode is for
>> quick dev. anyway, so I don't find that to be a limitation.
>>
>> To run app1, I do:
>>
>> mvn gwt:run -DrunTarget=my.package.App1/App1.html
>>
>> To run app2, I do:
>>
>> mvn gwt-run -DrunTarget=my.package.App2/App2.html
>>
>> ...or I create a Run/Debug target inside Eclipse and launch it with the
>> GWT eclipse plugin that way.
>>
>> Anyway, I wrote up a blog and sample project you can take a look at as a
>> skeleton here: http://zenoconsulting.wikidot.com/blog:16  -- if it helps
>> you/someone..great.
>>
>> Regards,
>> Davis
>>
>>
>> On Wed, Oct 14, 2009 at 8:20 PM, RSN <romeo.sanc...@gmail.com> wrote:
>>
>>>
>>> I am kind of new with GWT, and I was hoping someone could clarify my
>>> following questions, or at least point me out to some light. Thanks
>>> for any help.
>>>
>>> The setting is as follows:
>>>
>>> - Eclipse 3.4.2 , GWT 1.7.1 and plugin.
>>>
>>> - Created two basic GWT modules with GWT Plugin under Eclipse. Both
>>> are just copies of the GreetService application that gets generated by
>>> default when you create a new GWT project using the plugin Wizard.
>>>
>>> The modules are:
>>> -Security
>>> -Main
>>>
>>> The Main module is going to inherit the Security one. So, I modified
>>> the Main.gwt.xml file to inherit the security module.
>>> <inherits name='org.security.Security'/>
>>>
>>> In addition to this, Eclipse complained about the build path for the
>>> Main module when I did this change. So, I had to add the Security
>>> module as a "Required project on the build path" of the Main module.
>>> This step removed any problems in compilation time.
>>>
>>> So, I proceed to run the Main module. When, I ran the project, only
>>> one single Hosted-mode browser window opened. And, these are the
>>> problems encountered:
>>>
>>> - The single browser window contained elements (buttons, textboxes,
>>> etc) from both of the modules. So, I could see all html elements in a
>>> single window.
>>>
>>> First questions:
>>> Is this the desired behavior?
>>> Can we open more than one browser window, one per each module that has
>>> an entrypoint and refers to a html page?
>>> Is there a way to let each module know on which port each application
>>> will run? In other words, both of the modules are running in
>>> localhost, but I would like to set them to run in different ports such
>>> that there is no conflict.
>>>
>>> Then, I proceed to test the functionality of the elements in the
>>> single browser window. I clicked the button of the Main application
>>> that greets the Server. It worked well. No problems.
>>> Then, I clicked in the second button from the Security module to make
>>> an RPC to the server, and it got the default message: "An error
>>> occurred while attempting to contact the server. Please check network
>>> connection ..."
>>> I am guessing that the Server side of the Security module did not load
>>> because of the port issue. Is this true, or is there something else
>>> that I am missing?
>>>
>>> I get in the Hosted Mode Window also the following:
>>> 404 - POST /main/greet (127.0.0.1) 1396 bytes
>>>
>>> I notice that the main module do not have a "greet" servlet (since I
>>> refactored it). However, the Security module kept that servlet name,
>>> should not be /security/greet instead?, where is the application
>>> getting confused? Why the call is going to the main servlet to look
>>> for the "greet" service instead of going to the Security module
>>> servlet services?
>>>
>>> Is this feasible? I mean, can we debug and test functionality of cross
>>> referenced GWT modules/projects in Eclipse?
>>> I am a newbie, so is there somewhere a discussion, tutorial,
>>> documentation that I am missing?
>>>
>>> Thanks,
>>> p.s. Hope I could put some small images to better illustrate the
>>> issues.
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Zeno Consulting, Inc.
>> home: http://www.zenoconsulting.biz
>> blog: http://zenoconsulting.wikidot.com
>> p: 248.894.4922
>> f: 313.884.2977
>>
>>
>>
>
> >
>


-- 
Zeno Consulting, Inc.
home: http://www.zenoconsulting.biz
blog: http://zenoconsulting.wikidot.com
p: 248.894.4922
f: 313.884.2977

--~--~---------~--~----~------------~-------~--~----~
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-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to