PHP + GWT ????

2 views
Skip to first unread message

ben fenster

unread,
Nov 4, 2009, 8:56:38 AM11/4/09
to Google Web Toolkit
how can i send a post request to my php page without getting an
exception about same orign execution restriction

Ian Bambury

unread,
Nov 4, 2009, 9:13:04 AM11/4/09
to google-we...@googlegroups.com
Have everything in the same place if you can.

Run with the -noserver option and have a local web server point to your war directory

If that's too cryptic an answer, just shout and I'll give more detail.

ben fenster

unread,
Nov 4, 2009, 10:51:34 AM11/4/09
to Google Web Toolkit
it will help me alot if you could alaberate on the subject :)

On 4 נובמבר, 16:13, Ian Bambury <ianbamb...@gmail.com> wrote:
> Have everything in the same place if you can.
>
> Run with the -noserver option and have a local web server point to your war
> directory
>
> If that's too cryptic an answer, just shout and I'll give more detail.
>
> Ian
>
> http://examples.roughian.com
>
> 2009/11/4 ben fenster <fenster....@gmail.com>

Ian Bambury

unread,
Nov 4, 2009, 11:16:18 AM11/4/09
to google-we...@googlegroups.com
OK.

The way I do it is like this:

In the program arguments you need 

-noserver -port 1080

if you don't put the port, it will default to 80

in my launch file for my 1.7 minimum app I have

<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-noserver -port 80 -startupUrl index.html com.roughian.appmin_1_7.Module"/>

but however you run it, you need those arguments.

You also need a local web server. I use Abyss (since Apache seemed like overkill) and set it up so that the document root was pointing to the /war/ directory of my project and the port it was using was 1080, and it was also set up to deal with PHP, of course.

As far as I can remember, that's all you have to do.

The advantage of setting a port number is that you can then set up *another* project with another port number, and another instance of Abyss which is pointed at the new project's /war/ directory and uses the new port number.

What is more, you can run both projects in hosted mode at the same time.

In GWT 2.0, you can do exactly the same thing, but if you want to run more than one project in development mode at the same time, you will also need to add 

-portHosted 9998 

(or some other unique hosted mode port number)

If that doesn't make sense, or doesn't work, or you need help setting up Abyss (if you decide to use it), let me know.

Maciej Trela

unread,
Nov 4, 2009, 12:06:30 PM11/4/09
to Google Web Toolkit

Peter Quiel

unread,
Nov 5, 2009, 2:51:45 AM11/5/09
to Google Web Toolkit
Hi,

if you are using GWT 1.7 and Linux you can turn off same origin policy
of the hosted mode browser.

See http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/64f13e69867527da?pli=1

I don't know if you can't turn off the sop in ie as well.

Greetings,
Peter



On Nov 4, 6:06 pm, Maciej Trela <t.mac...@gmail.com> wrote:
> You can also try this:http://code.google.com/intl/pl-PL/webtoolkit/doc/1.6/FAQ_Server.html#...

ben fenster

unread,
Nov 7, 2009, 8:12:20 AM11/7/09
to Google Web Toolkit
where do i enter the program arguments and the same orign policy apply
to ports also so how can it be possible to run 2 diffrent web servers
on 2 diffrent ports without getting the error
> 2009/11/4 ben fenster <fenster....@gmail.com>

ben fenster

unread,
Nov 8, 2009, 6:54:59 AM11/8/09
to Google Web Toolkit


On Nov 4, 6:16 pm, Ian Bambury <ianbamb...@gmail.com> wrote:
> 2009/11/4 ben fenster <fenster....@gmail.com>

ben fenster

unread,
Nov 8, 2009, 6:55:03 AM11/8/09
to Google Web Toolkit
pls help i cant use hosted mode even after installing apache setting
the directory to my war
if i use browser it works fine but not in hosted mode pls help me

On Nov 4, 6:16 pm, Ian Bambury <ianbamb...@gmail.com> wrote:
> 2009/11/4 ben fenster <fenster....@gmail.com>

ben fenster

unread,
Nov 9, 2009, 5:00:53 AM11/9/09
to Google Web Toolkit
thank u very much i managed to use -noserver and it works great
how the hell can gwt debug the js code running on another web
server ?!??!?

Ian Bambury

unread,
Nov 9, 2009, 2:18:07 PM11/9/09
to google-we...@googlegroups.com
Hi Ben,

I've been away for a long weekend and only just got back. Is it working OK?

ben fenster

unread,
Nov 10, 2009, 8:22:03 AM11/10/09
to Google Web Toolkit
yes it works great thanks :)
but i was wondering how the hell can gwt debug the js code running on
another web
server in my case apache ?!??!?

On Nov 9, 9:18 pm, Ian Bambury <ianbamb...@gmail.com> wrote:
> Hi Ben,
>
> I've been away for a long weekend and only just got back. Is it working OK?
>
> Ian
>
> http://examples.roughian.com
>
> 2009/11/9 ben fenster <fenster....@gmail.com>

Thomas Broyer

unread,
Nov 10, 2009, 7:45:10 PM11/10/09
to Google Web Toolkit


On 10 nov, 14:22, ben fenster <fenster....@gmail.com> wrote:
> yes it works great thanks :)
> but i was wondering how the hell can gwt debug the js code running on
> another web
> server in my case apache ?!??!?

It doesn't debug the code that's on your server, but the one that's on
your PC (and the js code do not "run" on the server ;-) )
When the *.cache.js is loaded (from your Apache server), it detects
that it's running in the HostedMode browser and then uses some special
APIs to talk to the HostedMode and actually run your Java code on your
PC, which allows you to debug it.
Reply all
Reply to author
Forward
0 new messages