I think the point we're missing is who is "I" in "If I would like this
program to start in demo mode".   You're saying that you want a setup
where you fire up the server in one mode or the other, and everyone
who accesses the page gets the one same mode depending on how you
start the server?  Well that's pretty easy, you could for instance use
servlet parameters specified in your web.xml file.  Here's a random
google webpage with code for that: 
http://www.exampledepot.com/egs/javax.servlet/GetInit.html

More normal, and a good use of deferred binding, would be to have two
slightly different addresses, one for demo and one for normal mode, so
you can just point people to the appropriate site and not have to
restart the server every time you want to change the mode everyone
sees.  If you do that, you could pass a parameter to your server RPC
calls indicating that the client is running in one mode or the other
to have the server respond with the correct stuff.

On Apr 21, 9:04 pm, "[email protected]" <[email protected]> wrote:
> hmm...I guess I'm not being clear enough.
>
> Say in your run of the mill Java CLI programs. If I would like this
> program to start in demo mode to show certain messages, then I would
> do:
> java programName demo
> The program would see the 'demo' argument in the main method.
>
> In the GWT case, I would like to be able to do the same to the server.
> The client's GUI can already act in normal or demo mode based on one
> initial "is-the-server-running-in-demo-mode" GWT-RPC call to the
> server. At the moment the RPC implementation is just hardcoded to
> return a static final boolean. The server's code also looks at this
> variable in various places to decide whether a piece of functionality
> should act in normal or demo mode.
>
> Obviously using a variable in this way is pointless as I would have to
> recompile the code and redeploy the WAR file if I wanted to change
> modes. Hence, if I was able to use something like argv[] in the CLI
> example, it would just be a matter of restarting the server with
> different arguments.
>
> I hope thats made my use case a bit clearer.
>
> Sunny

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to