开发者

Debugging a GWT app which needs access to an external resource (Same Origin Policy)

开发者 https://www.devze.com 2023-03-05 17:46 出处:网络
We have a GWT application which draws some resources from a separate servlet via async javascript. In production this poses no problems as both the producer servlet and the c开发者_如何学运维onsumer G

We have a GWT application which draws some resources from a separate servlet via async javascript. In production this poses no problems as both the producer servlet and the c开发者_如何学运维onsumer GWT app will reside on the same server, however for development I can't find a way to make this happen as we are head to head with the Same Origin Policy.

As a temporary solution I have the servlet running on Tomcat, and I compile and deploy the GWT app to that same Tomcat instance - this of course works, and it does allow me to attach Eclipse for debugging. However there is the slight problem of the 40 second or so build time for each modification.

We would like to be able to debug via GWT's hosted mode w/ OOPHM - can anybody see a way for us to do this?

Thanks all!


you could use the -noserver option of gwt dev mode, which lets you run your server code with any servlet container.


Maybe you can deploy the producer servlet to Jetty.

http://www.enavigo.com/2008/08/29/deploying-a-web-application-to-jetty/

I think the Jetty home most reside somewhere in the Eclipse directories. A simple file search might help.

Good luck!


If you need just a servlet, why not define it in web.xml and start dev mode as usual?

0

精彩评论

暂无评论...
验证码 换一张
取 消