Ian,
Sorry, I needed to disable my internal checks for hosted mode (to fail
XHR).
This does work. Tomcat's same-origin must be same-host only, which
works find with the Eclipse proxy. Thanks for your posts which helped
me get to a functional hosted mode test environment.
On Feb 12, 7:32 pm, "
MikeLisa...@gmail.com" <
MikeLisa...@gmail.com>
wrote:
> Ian,
>
> How does usinghttp://localhostas the URL base for XMLHttpRequest get
> us past the same-origin policy wherehostedmodeis running from
> localhost:8888?
>
> There was a similar discussion about using Eclipse's http proxy to go
> directly from localhost to the targetPHPserver, but they seam to
> have run into the same problem. localhost != localhost:8888. Only
> solution seams to be either serve RPC from embedded Tomcat (only Java
> RPC) or export the compiled output from GWT and runhostedmodeby
> serving all dynamic and static content from the server (almost
> deployed but still allows java debugging).
>
> Is there something I am missing?
>
> On Jan 16, 6:30 pm, "Ian Bambury" <
ianbamb...@gmail.com> wrote:
>
> > I use a different method.
>
> > I keep the devphpcode in the project e.g. in the current project this is /
> > RXChat-1.1.001/src/com/roughian/chat.public/php/ which means it is easy to
> > edit in Eclipse, just like any other file in the project.
>
> > In the project directory I put a copy of Abyss (web server - 500Kb) and a
> > copy ofPHP(16Mb) - so every project usingPHPhas these. The advantage of
> > having both these in the project directory is that a) you can use relative
> > paths which makes it portable and b) once set up, if you change to work on a
> > different project, you shut down one Abyss server and fire up the
> > preconfigured one in the project folder.
>
> > So anyway, you point Abyss's webroot at your public directory so it picks up
> > your development files and add inPHPand off you go.
>
> > The only other thing is that calls in code tophpprograms go by default to
> > Tomcat on localhost:8888 and you need to get yourPHPfiles from plain old
> > localhost (Abyss on port 80) . So you need a routine to switch depending
> > what you are doing
>
> > private final static String getPhpUrl()
> > {
> > String url = GWT.getModuleBaseURL();
>
> > String bits[] = url.split("/");
> > if (bits[2].equals("localhost:8888")) url = "
http://localhost";
> > return url + "/";
> > }
> > You can also change the port Abyss is running on for each project and then
> > you can run 4 or 5 copies of Abyss and swap between projects at will.
> > Personally I don't bother.
>
> > Nowhere near as concise as Jean-Phillipe's answer, but this way all the code
> > runs out of the project directory and is therefore available directly in
> > Eclipse, and you can runhostedmodestraight out of Eclipse complete with