Re: Request Builder Error - GWT

2011-10-06 Thread Thomas Broyer


On Thursday, October 6, 2011 1:32:03 PM UTC+2, coffeMan wrote:
>
> Can anyone tell me what the error might be coming from? I cannot get 
> passed this, Thanks! 
>
>  [WARN] Exception while dispatching incoming RPC call 
> com.google.gwt.user.server.rpc.UnexpectedException: Service method 
> 'public abstract java.lang.String 
> com.mymaps.client.dataService.getData(java.lang.String)' threw an 
> unexpected exception: java.lang.UnsatisfiedLinkError: 
> com.google.gwt.http.client.URL.encodeImpl(Ljava/lang/String;)Ljava/ 
> lang/String; 
>
[...]

> Caused by: java.lang.UnsatisfiedLinkError: 
> com.google.gwt.http.client.URL.encodeImpl(Ljava/lang/String;)Ljava/ 
> lang/String; 
> at com.google.gwt.http.client.URL.encodeImpl(Native Method) 
> at com.google.gwt.http.client.URL.encode(URL.java:155) 
>


You're calling com.google.gwt.http.client.URL.encode() on the server.

The exact cause of the error is that URL.encodeImpl is a JSNI method, and 
JSNI is kind of a "hack" in that it uses the syntax for native methods 
(methods provided at runtime by native libraries –DLLs or equivalent–) 
followed by a Java comment with a specific "syntax". Java, on the server 
side, just sees a native method, so it tries to resolve it from a native 
library, and it fails to find the "link" to that library (hence 
UnsatifiedLinkError).

You should use java.net.URLEncoder or, e.g., URIUtils from Apache 
HttpClient.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/kggr-zPFZN0J.
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.



Request Builder Error - GWT

2011-10-06 Thread coffeMan
Can anyone tell me what the error might be coming from? I cannot get
passed this, Thanks!

 [WARN] Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract java.lang.String
com.mymaps.client.dataService.getData(java.lang.String)' threw an
unexpected exception: java.lang.UnsatisfiedLinkError:
com.google.gwt.http.client.URL.encodeImpl(Ljava/lang/String;)Ljava/
lang/String;
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:
385)
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
588)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
208)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:
248)
at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:
62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
362)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
729)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at
org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:
49)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
505)
at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:843)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
395)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.UnsatisfiedLinkError:
com.google.gwt.http.client.URL.encodeImpl(Ljava/lang/String;)Ljava/
lang/String;
at com.google.gwt.http.client.URL.encodeImpl(Native Method)
at com.google.gwt.http.client.URL.encode(URL.java:155)
at com.mymaps.server.dataServiceImpl.getData(dataServiceImpl.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
569)

-- 
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.



Re: Java Servlet and Same Origin Policy question using GWT Request Builder

2011-10-03 Thread coffeMan
can i change what address is outputted from Eclipse GWT? I believe it
is my IP:port/.html?gwt.codes=IP:9997

I am assuming that is what it is comparing to in relation to my java
servlet i am trying to parse

On Oct 3, 1:06 pm, Jens  wrote:
> As long as protocol, domain and port number do not change you wont have a
> problem regarding same origin policy.If they change you can use
> JSONPRequstBuilder (requires some changes in your servlet to make it jsonp
> compliant) or you have to use a reverse proxy to map the external servlet to
> the domain of your gwt app.
>
> -- J.

-- 
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.



Re: Java Servlet and Same Origin Policy question using GWT Request Builder

2011-10-03 Thread Jens
As long as protocol, domain and port number do not change you wont have a 
problem regarding same origin policy.If they change you can use 
JSONPRequstBuilder (requires some changes in your servlet to make it jsonp 
compliant) or you have to use a reverse proxy to map the external servlet to 
the domain of your gwt app.

-- J.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/2JRhD9LX3hcJ.
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.



Java Servlet and Same Origin Policy question using GWT Request Builder

2011-10-03 Thread coffeMan
I created a Java Servlet on a test machine, on network. I want to
create a gwt app to call that servlet and retrieve XML from it using
the request builder from a different machine but on the same network.
Is this going to invoke SOP?

-- 
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.



Re: Request Builder

2011-07-04 Thread Elhanan Maayan
actually we've decided to abandon RequestFactory framework for the reason
that it cannot be ported elsewhere.
that is if we decided to have other clients such as silverlight/flex, those
won't have request factory capabilities . so it kinda binds us to gwt.

On Mon, Jul 4, 2011 at 12:56 PM, Robert W  wrote:

> After some research i can say that there is general problem with
> advanced communication outside servlet/app engine. Problem is easy
> serialization. I created own based solution on JavascriptObject and
> amfphp. Serializaing transparently but I write java DTO by hand.
> JavascriptObject is problematic in this regard that cant have useful
> constructor and no more than one class can implement interface and
> there is no reflections java methods in gwt client side that
> summarized now I write javascript code to send as hint for server
> deserializiation. it should be created by gwt Generator but generator
> must form complete classes (more work for me now).
> On Jul 3, 5:05 am, sanjay kanwar  wrote:
> > Hi There,
> >
> > I have a task in which i hav to use Request Builder and JSON to fetch the
> > data frm the php server and show it in the screen in the form of image
> > representating tht data. I am new to jst a recent graduate and new to
> this
> > technology any help about how to proceed  would be very helpful.
> >
> > Thanks in Advance
> > Sanjay Kanwar
>
> --
> 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.
>
>

-- 
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.



Re: Request Builder

2011-07-04 Thread Robert W
After some research i can say that there is general problem with
advanced communication outside servlet/app engine. Problem is easy
serialization. I created own based solution on JavascriptObject and
amfphp. Serializaing transparently but I write java DTO by hand.
JavascriptObject is problematic in this regard that cant have useful
constructor and no more than one class can implement interface and
there is no reflections java methods in gwt client side that
summarized now I write javascript code to send as hint for server
deserializiation. it should be created by gwt Generator but generator
must form complete classes (more work for me now).
On Jul 3, 5:05 am, sanjay kanwar  wrote:
> Hi There,
>
> I have a task in which i hav to use Request Builder and JSON to fetch the
> data frm the php server and show it in the screen in the form of image
> representating tht data. I am new to jst a recent graduate and new to this
> technology any help about how to proceed  would be very helpful.
>
> Thanks in Advance
> Sanjay Kanwar

-- 
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.



Re: Request Builder

2011-07-03 Thread Alisson Prestes
Your question is very broad. I can only suggest you some official
tutorials:

   1. You can read the tutorial that will teach you how to communicate with
   the server here:
   http://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html
   2. This other tutorial will teach you how to create UI using GWT:
   http://code.google.com/webtoolkit/doc/latest/tutorial/gettingstarted.html
   3. The image you need to create probably can be created using the Google
   Chart Tools API:
   http://code.google.com/p/gwt-google-apis/wiki/VisualizationGettingStarted
   4. Depending on the size of your application, you may wish to use
   Activities and Places to keep everything organized:
   
http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html

If your question is about a more specific topic, please supply more details.


Alisson Prestes
www.google.com/profiles/javalisson



On Sun, Jul 3, 2011 at 12:05 AM, sanjay kanwar wrote:

> Hi There,
>
> I have a task in which i hav to use Request Builder and JSON to fetch the
> data frm the php server and show it in the screen in the form of image
> representating tht data. I am new to jst a recent graduate and new to this
> technology any help about how to proceed  would be very helpful.
>
>
> Thanks in Advance
> Sanjay Kanwar
>
> --
> 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.
>

-- 
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.



Request Builder

2011-07-02 Thread sanjay kanwar
Hi There,

I have a task in which i hav to use Request Builder and JSON to fetch the
data frm the php server and show it in the screen in the form of image
representating tht data. I am new to jst a recent graduate and new to this
technology any help about how to proceed  would be very helpful.


Thanks in Advance
Sanjay Kanwar

-- 
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.



Re: Request Builder and cross domain requests

2011-01-03 Thread Thomas Broyer
Yes: http://en.wikipedia.org/wiki/Same_origin_policy and 
http://tools.ietf.org/html/draft-abarth-origin

-- 
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-tool...@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.



Request Builder and cross domain requests

2011-01-03 Thread byhisdeeds
I am trying to use RequestBuilder to access an xml document that is
available on the same server as my GWT 2.1 application but in a
different servlet container. Thus my GWT application is accessed via
http://localhost:8084/sdv and the xml document is accessed via
localhost:8086:/geoserver/rest/...

The code I am using is shown below.

RequestBuilder builder = new RequestBuilder( RequestBuilder.GET,
getRestUrl(layer));
try
{
  Request request = builder.sendRequest(null, new
RequestCallback()
  {
public void onError(Request request, Throwable exception)
{
}
public void onResponseReceived(Request request, Response
response)
{
}
  });
}
catch (RequestException e)
{
}

Is it that the domain is bboth the server and port, not just the
server.

John

-- 
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-tool...@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.



Request Builder

2010-11-09 Thread swingm
When using GWT RPC mechanism , the proxy class calls the method on
RequestBuilder to which it sends the parameterized requestData.  I
want to make this independently in my presenter. can anyone suggest
how to do this


RequestBuilder rb = doPrepareRequestBuilderImpl(responseReader,
methodName,
invocationCount, requestData, callback);

-- 
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-tool...@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.



Re: Issue with XML object passing using Request Builder

2010-11-08 Thread jayalakshmi jahagirdar
 hi,

 response=(HttpServletResponse) xmlobject.*method();*
**
Is this the correct way of adding the object to response.
Iam getting following error.

Apache Tomcat/6.0.29 - Error report<!--H1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
{color : black;}A.name {color : black;}HR {color : #525D76;}-->
HTTP Status 404 -
/Draw/com.mycompany.project.ImageViewer/%20SampleServlettype Status reportmessage
/Draw/com.mycompany.project.ImageViewer/%20SampleServletdescription
The requested resource
(/Draw/com.mycompany.project.ImageViewer/%20SampleServlet) is not
available.Apache
Tomcat/6.0.29


On Tue, Nov 9, 2010 at 10:32 AM, jayalakshmi jahagirdar <
jayalakshmi.jahagir...@gmail.com> wrote:

> Thanks  Fernando for the reply.
>
> Can u please share a method of sending my object of XML to client (Iam
> using request builder).
> I want to know how i can add this object of XML to the 
> response(HttpServletResponse response)
> in my servlet so that i can navigate it to client.
>
> Thanks
> jaya
>
>   On Mon, Nov 8, 2010 at 8:36 PM, Fernando wrote:
>
>>
>> http://code.google.com/webtoolkit/doc/1.6/DevGuideCodingBasics.html#DevGuideXML
>>
>> On Nov 8, 10:47 am, jayalakshmi jahagirdar
>>   wrote:
>> > hello all,
>> > I have the following requierement:
>> >
>> > A XML file is at the server side.Need to parse it .
>> > I have a nested class . Create a object of this nested class ,add
>> parametres
>> > from XML parsing to this object and pass it back to the client.
>> > Iam making use of RequestBuilder.
>> >
>> > Iam able to parse it and create the object. but not finding a way to
>> pass it
>> > back to the client.
>> >
>> > Which is the best way to implement this. Can i make use of RPC ?
>> >
>> > Thanks & regards
>> > Jaya
>>
>> --
>> 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-tool...@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.
>>
>>
>

-- 
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-tool...@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.



Re: Issue with XML object passing using Request Builder

2010-11-08 Thread jayalakshmi jahagirdar
Thanks  Fernando for the reply.

Can u please share a method of sending my object of XML to client (Iam using
request builder).
I want to know how i can add this object of XML to the
response(HttpServletResponse response)
in my servlet so that i can navigate it to client.

Thanks
jaya

On Mon, Nov 8, 2010 at 8:36 PM, Fernando  wrote:

>
> http://code.google.com/webtoolkit/doc/1.6/DevGuideCodingBasics.html#DevGuideXML
>
> On Nov 8, 10:47 am, jayalakshmi jahagirdar
>   wrote:
> > hello all,
> > I have the following requierement:
> >
> > A XML file is at the server side.Need to parse it .
> > I have a nested class . Create a object of this nested class ,add
> parametres
> > from XML parsing to this object and pass it back to the client.
> > Iam making use of RequestBuilder.
> >
> > Iam able to parse it and create the object. but not finding a way to pass
> it
> > back to the client.
> >
> > Which is the best way to implement this. Can i make use of RPC ?
> >
> > Thanks & regards
> > Jaya
>
> --
> 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-tool...@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.
>
>

-- 
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-tool...@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.



Re: Issue with XML object passing using Request Builder

2010-11-08 Thread Fernando
http://code.google.com/webtoolkit/doc/1.6/DevGuideCodingBasics.html#DevGuideXML

On Nov 8, 10:47 am, jayalakshmi jahagirdar
 wrote:
> hello all,
> I have the following requierement:
>
> A XML file is at the server side.Need to parse it .
> I have a nested class . Create a object of this nested class ,add parametres
> from XML parsing to this object and pass it back to the client.
> Iam making use of RequestBuilder.
>
> Iam able to parse it and create the object. but not finding a way to pass it
> back to the client.
>
> Which is the best way to implement this. Can i make use of RPC ?
>
> Thanks & regards
> Jaya

-- 
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-tool...@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.



Issue with XML object passing using Request Builder

2010-11-08 Thread jayalakshmi jahagirdar
hello all,
I have the following requierement:

A XML file is at the server side.Need to parse it .
I have a nested class . Create a object of this nested class ,add parametres
from XML parsing to this object and pass it back to the client.
Iam making use of RequestBuilder.

Iam able to parse it and create the object. but not finding a way to pass it
back to the client.

Which is the best way to implement this. Can i make use of RPC ?

Thanks & regards
Jaya

-- 
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-tool...@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.



Re: Crossdomain -POST Request using Request Builder

2010-11-03 Thread Raghunath
Actually the status code is always 0 , digging for more. If you have
any solution please let me know

On Nov 4, 9:25 am, Raghunath  wrote:
> Hi
>
> I'm trying to post a text message to cross-domain using
> RequestBuilder. Problem is the remote server is getting the request.
> But the GWT client is getting empty string iin the response. I tried
> in several ways but no use.
>
> Please suggest me.
>
>                 for (RESTClientListeners restClient : listeners) {
>                         restClient.onLoadingStart();
>                 }
>
>                 callURLPOST(request.toString(), completeUrl,new 
> HTTPClientListener()
> {
>
>                         @Override
>                         public void onSucess(String data) {
>                                 try {
>                                         JSONArray resp=new JSONArray(data);
>                                         if(resp.getInt(0)==1){
>                                                 for (RESTClientListeners 
> restClient : listeners) {
>                                                         
> restClient.onSucess(resp.getJSONObject(1));
>                                                 }
>                                         }else if(resp.getInt(0)!=1){
>                                                 for (RESTClientListeners 
> restClient : listeners) {
>                                                         
> restClient.onFail(resp.get(1));
>                                                 }
>                                         }
>
>                                 } catch (JSONException e) {
>                                         
> AppLogManager.get().logError(RESTClient.class,e);
>                                 }
>
>                         }
>
> -raghu

-- 
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-tool...@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.



Crossdomain -POST Request using Request Builder

2010-11-03 Thread Raghunath
Hi

I'm trying to post a text message to cross-domain using
RequestBuilder. Problem is the remote server is getting the request.
But the GWT client is getting empty string iin the response. I tried
in several ways but no use.

Please suggest me.


for (RESTClientListeners restClient : listeners) {
restClient.onLoadingStart();
}

callURLPOST(request.toString(), completeUrl,new 
HTTPClientListener()
{

@Override
public void onSucess(String data) {
try {
JSONArray resp=new JSONArray(data);
if(resp.getInt(0)==1){
for (RESTClientListeners 
restClient : listeners) {

restClient.onSucess(resp.getJSONObject(1));
}
}else if(resp.getInt(0)!=1){
for (RESTClientListeners 
restClient : listeners) {

restClient.onFail(resp.get(1));
}
}

} catch (JSONException e) {

AppLogManager.get().logError(RESTClient.class,e);
}

}

-raghu

-- 
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-tool...@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.



Re: REQUEST BUILDER + JSON OBJECT + PHP SERVER SIDE LANGUAGE

2010-10-08 Thread Alessio unibs
Hi guys, i solved my problem using $HTTP_RAW_POST_DATA as Thomas
Broyer suggests;

Thank you for helping me

On 7 Ott, 17:55, Ketan Shah  wrote:
> try
>
> trasmettiJSON.setHeader("Content-Type","application/x-www-form-
> urlencoded");
>
> On Oct 7, 1:58 am, Alessio unibs  wrote:
>
> > Hi, i have problem by using gwt requestbuilder to make http request
> > with json object in body messages. In the server side code, i use php,
> > but when i try to access request's data, the $_POST variable is empty.
> > I post the code below:
>
> > String path = GWT.getHostPageBaseURL() + "JsonObjectReceiver.php";
>
> >                         RequestBuilder trasmettiJSON = new
> > RequestBuilder(RequestBuilder.POST, URL.encode(path));
> >                         trasmettiJSON.setHeader("Content-Type", 
> > "application/json");
>
> >                         //L'evento contiene due oggetti da tenere in 
> > considerazione
> >                         PrenotazioneJSON pj = 
> > event.getData(Costanti.OGGETTI_DA_INVIARE);
> >                         final WCard corrente =
> > event.getData(Costanti.CARD_CORRENTE_PASSO3);
>
> >                         try{
> >                                 @SuppressWarnings("unused")
> >                                 Request req = 
> > trasmettiJSON.sendRequest(pj.getInfo_generali(), new
> > RequestCallback() {
>
> >                                         @Override
> >                                         public void 
> > onResponseReceived(Request request, Response
> > response) {
> >                                                 if (200 == 
> > response.getStatusCode()) {
>
> >                                                         AppEvent xmlCorrect 
> > = new AppEvent(StartEvents.xmlWritten);
> >                                                         
> > xmlCorrect.setData(Costanti.CARD_CORRENTE_PASSO3, corrente);
>
> >                                                         
> > xmlCorrect.setData("status", response.getText());
> >                                                         
> > forwardToView(passo3View, xmlCorrect);
> >                                           } else {
> >                                            // displayError("Couldn't 
> > retrieve JSON (" +
> > response.getStatusText()+ ")", corrente);
> >                                           }
>
> >                                         }
>
> >                                         @Override
> >                                         public void onError(Request 
> > request, Throwable exception) {
> >                                                 //displayError("Couldn't 
> > retrieve JSON");
>
> >                                         }
> >                                 });
>
> >                         }catch(RequestException e) {
> >                               //displayError("Couldn't retrieve JSON");
>
> > }
>
> > CAN SOMEONE HELP ME PLEASE? I'M NEW TO GWT, SO I HAVE NOT A LOT OF
> > EXPERIENCE.
> > THANKS IN ADVANCE FOR ANSWERS
>
> > ALESSIO

-- 
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-tool...@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.



Re: REQUEST BUILDER + JSON OBJECT + PHP SERVER SIDE LANGUAGE

2010-10-07 Thread Ketan Shah
try

trasmettiJSON.setHeader("Content-Type","application/x-www-form-
urlencoded");

On Oct 7, 1:58 am, Alessio unibs  wrote:
> Hi, i have problem by using gwt requestbuilder to make http request
> with json object in body messages. In the server side code, i use php,
> but when i try to access request's data, the $_POST variable is empty.
> I post the code below:
>
> String path = GWT.getHostPageBaseURL() + "JsonObjectReceiver.php";
>
>                         RequestBuilder trasmettiJSON = new
> RequestBuilder(RequestBuilder.POST, URL.encode(path));
>                         trasmettiJSON.setHeader("Content-Type", 
> "application/json");
>
>                         //L'evento contiene due oggetti da tenere in 
> considerazione
>                         PrenotazioneJSON pj = 
> event.getData(Costanti.OGGETTI_DA_INVIARE);
>                         final WCard corrente =
> event.getData(Costanti.CARD_CORRENTE_PASSO3);
>
>                         try{
>                                 @SuppressWarnings("unused")
>                                 Request req = 
> trasmettiJSON.sendRequest(pj.getInfo_generali(), new
> RequestCallback() {
>
>                                         @Override
>                                         public void 
> onResponseReceived(Request request, Response
> response) {
>                                                 if (200 == 
> response.getStatusCode()) {
>
>                                                         AppEvent xmlCorrect = 
> new AppEvent(StartEvents.xmlWritten);
>                                                         
> xmlCorrect.setData(Costanti.CARD_CORRENTE_PASSO3, corrente);
>
>                                                         
> xmlCorrect.setData("status", response.getText());
>                                                         
> forwardToView(passo3View, xmlCorrect);
>                                           } else {
>                                            // displayError("Couldn't retrieve 
> JSON (" +
> response.getStatusText()+ ")", corrente);
>                                           }
>
>                                         }
>
>                                         @Override
>                                         public void onError(Request request, 
> Throwable exception) {
>                                                 //displayError("Couldn't 
> retrieve JSON");
>
>                                         }
>                                 });
>
>                         }catch(RequestException e) {
>                               //displayError("Couldn't retrieve JSON");
>
> }
>
> CAN SOMEONE HELP ME PLEASE? I'M NEW TO GWT, SO I HAVE NOT A LOT OF
> EXPERIENCE.
> THANKS IN ADVANCE FOR ANSWERS
>
> ALESSIO

-- 
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-tool...@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.



Re: REQUEST BUILDER + JSON OBJECT + PHP SERVER SIDE LANGUAGE

2010-10-07 Thread Thomas Broyer


On Oct 7, 11:30 am, Alessio unibs  wrote:
> Hi andy, thank you for answer;
> Yes i try setRequestData, and if i'am right, i must use send() method
> to send the request.
> I did that but the $_POST php variable was empty again. My php file is
> for now:
>
>          $jsonGenerale = $_POST;
>         echo(count($jsonGenerale));
> ?>
>
> THANK YOU IN ADVANCE

What you need is $HTTP_RAW_POST_DATA, not $_POST (it only works with
"form data" in either multipart/form-data or application/x-www-form-
urlencoded form, not with application/json).

http://www.php.net/manual/en/reserved.variables.httprawpostdata.php
http://www.php.net/manual/en/reserved.variables.post.php

-- 
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-tool...@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.



Re: REQUEST BUILDER + JSON OBJECT + PHP SERVER SIDE LANGUAGE

2010-10-07 Thread Alessio unibs
Hi andy, thank you for answer;
Yes i try setRequestData, and if i'am right, i must use send() method
to send the request.
I did that but the $_POST php variable was empty again. My php file is
for now:



THANK YOU IN ADVANCE

On 7 Ott, 07:18, andy stevko  wrote:
> Did you try
>
> public void *setRequestData*(java.lang.String requestData)
>
> On Wed, Oct 6, 2010 at 1:58 PM, Alessio unibs  wrote:
> > Hi, i have problem by using gwt requestbuilder to make http request
> > with json object in body messages. In the server side code, i use php,
> > but when i try to access request's data, the $_POST variable is empty.
> > I post the code below:
>
> > String path = GWT.getHostPageBaseURL() + "JsonObjectReceiver.php";
>
> >                        RequestBuilder trasmettiJSON = new
> > RequestBuilder(RequestBuilder.POST, URL.encode(path));
> >                        trasmettiJSON.setHeader("Content-Type",
> > "application/json");
>
> >                        //L'evento contiene due oggetti da tenere in
> > considerazione
> >                        PrenotazioneJSON pj =
> > event.getData(Costanti.OGGETTI_DA_INVIARE);
> >                        final WCard corrente =
> > event.getData(Costanti.CARD_CORRENTE_PASSO3);
>
> >                        try{
> >                               �...@suppresswarnings("unused")
> >                                Request req =
> > trasmettiJSON.sendRequest(pj.getInfo_generali(), new
> > RequestCallback() {
>
> >                                       �...@override
> >                                        public void
> > onResponseReceived(Request request, Response
> > response) {
> >                                                if (200 ==
> > response.getStatusCode()) {
>
> >                                                        AppEvent xmlCorrect
> > = new AppEvent(StartEvents.xmlWritten);
>
> >  xmlCorrect.setData(Costanti.CARD_CORRENTE_PASSO3, corrente);
>
> >  xmlCorrect.setData("status", response.getText());
>
> >  forwardToView(passo3View, xmlCorrect);
> >                                          } else {
> >                                           // displayError("Couldn't
> > retrieve JSON (" +
> > response.getStatusText()+ ")", corrente);
> >                                          }
>
> >                                        }
>
> >                                       �...@override
> >                                        public void onError(Request request,
> > Throwable exception) {
> >                                                //displayError("Couldn't
> > retrieve JSON");
>
> >                                        }
> >                                });
>
> >                        }catch(RequestException e) {
> >                              //displayError("Couldn't retrieve JSON");
> > }
>
> > CAN SOMEONE HELP ME PLEASE? I'M NEW TO GWT, SO I HAVE NOT A LOT OF
> > EXPERIENCE.
> > THANKS IN ADVANCE FOR ANSWERS
>
> > ALESSIO
>
> > --
> > 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-tool...@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.

-- 
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-tool...@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.



Re: REQUEST BUILDER + JSON OBJECT + PHP SERVER SIDE LANGUAGE

2010-10-06 Thread andy stevko
Did you try

public void *setRequestData*(java.lang.String requestData)



On Wed, Oct 6, 2010 at 1:58 PM, Alessio unibs  wrote:

> Hi, i have problem by using gwt requestbuilder to make http request
> with json object in body messages. In the server side code, i use php,
> but when i try to access request's data, the $_POST variable is empty.
> I post the code below:
>
> String path = GWT.getHostPageBaseURL() + "JsonObjectReceiver.php";
>
>RequestBuilder trasmettiJSON = new
> RequestBuilder(RequestBuilder.POST, URL.encode(path));
>trasmettiJSON.setHeader("Content-Type",
> "application/json");
>
>//L'evento contiene due oggetti da tenere in
> considerazione
>PrenotazioneJSON pj =
> event.getData(Costanti.OGGETTI_DA_INVIARE);
>final WCard corrente =
> event.getData(Costanti.CARD_CORRENTE_PASSO3);
>
>try{
>@SuppressWarnings("unused")
>Request req =
> trasmettiJSON.sendRequest(pj.getInfo_generali(), new
> RequestCallback() {
>
>@Override
>public void
> onResponseReceived(Request request, Response
> response) {
>if (200 ==
> response.getStatusCode()) {
>
>AppEvent xmlCorrect
> = new AppEvent(StartEvents.xmlWritten);
>
>  xmlCorrect.setData(Costanti.CARD_CORRENTE_PASSO3, corrente);
>
>
>  xmlCorrect.setData("status", response.getText());
>
>  forwardToView(passo3View, xmlCorrect);
>  } else {
>   // displayError("Couldn't
> retrieve JSON (" +
> response.getStatusText()+ ")", corrente);
>  }
>
>
>}
>
>@Override
>public void onError(Request request,
> Throwable exception) {
>//displayError("Couldn't
> retrieve JSON");
>
>
>}
>});
>
>}catch(RequestException e) {
>  //displayError("Couldn't retrieve JSON");
> }
>
> CAN SOMEONE HELP ME PLEASE? I'M NEW TO GWT, SO I HAVE NOT A LOT OF
> EXPERIENCE.
> THANKS IN ADVANCE FOR ANSWERS
>
> ALESSIO
>
> --
> 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-tool...@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.
>
>

-- 
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-tool...@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.



REQUEST BUILDER + JSON OBJECT + PHP SERVER SIDE LANGUAGE

2010-10-06 Thread Alessio unibs
Hi, i have problem by using gwt requestbuilder to make http request
with json object in body messages. In the server side code, i use php,
but when i try to access request's data, the $_POST variable is empty.
I post the code below:

String path = GWT.getHostPageBaseURL() + "JsonObjectReceiver.php";

RequestBuilder trasmettiJSON = new
RequestBuilder(RequestBuilder.POST, URL.encode(path));
trasmettiJSON.setHeader("Content-Type", 
"application/json");

//L'evento contiene due oggetti da tenere in 
considerazione
PrenotazioneJSON pj = 
event.getData(Costanti.OGGETTI_DA_INVIARE);
final WCard corrente =
event.getData(Costanti.CARD_CORRENTE_PASSO3);

try{
@SuppressWarnings("unused")
Request req = 
trasmettiJSON.sendRequest(pj.getInfo_generali(), new
RequestCallback() {

@Override
public void onResponseReceived(Request 
request, Response
response) {
if (200 == 
response.getStatusCode()) {

AppEvent xmlCorrect = 
new AppEvent(StartEvents.xmlWritten);

xmlCorrect.setData(Costanti.CARD_CORRENTE_PASSO3, corrente);


xmlCorrect.setData("status", response.getText());

forwardToView(passo3View, xmlCorrect);
  } else {
   // displayError("Couldn't retrieve 
JSON (" +
response.getStatusText()+ ")", corrente);
  }


}

@Override
public void onError(Request request, 
Throwable exception) {
//displayError("Couldn't 
retrieve JSON");


}
});

}catch(RequestException e) {
  //displayError("Couldn't retrieve JSON");
}

CAN SOMEONE HELP ME PLEASE? I'M NEW TO GWT, SO I HAVE NOT A LOT OF
EXPERIENCE.
THANKS IN ADVANCE FOR ANSWERS

ALESSIO

-- 
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-tool...@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.



Re: I need a little help with request builder

2010-08-16 Thread nacho
Yes, i thought to do in that way.

But the trouble is that i need to work with 3 files, and i need to
execute more than one method over the file contents, so that was that
i was wondering some how to make sure that the content was loaded and
then work with it.

On 16 ago, 14:45, André Moraes  wrote:
> If i get it correct:
>
> 1- Your file as a file that your server will serve when you make a GET
> request.
> 2- You are using RequestBuilder to open a connection to your server and
> fetch the file
> 3- If all of this is true, you should do:
> 3.1 -> create the requestbuilder and point it to your file
> 3.2 -> you created your request passing a RequestCallback 
> (see:http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/g...
> )
> 3.3 -> Inside the onResponseReceived of that call, you write the logic to
> load and process your file.
>
> This approach is much more complex but this have the advantage of not
> blocking the browser.
>
> Hope it helps,
>
> --
> André Moraes
> Analista de Desenvolvimento de Sistemas
> andr...@gmail.comhttp://andredevchannel.blogspot.com/

-- 
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-tool...@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.



Re: I need a little help with request builder

2010-08-16 Thread André Moraes
If i get it correct:

1- Your file as a file that your server will serve when you make a GET
request.
2- You are using RequestBuilder to open a connection to your server and
fetch the file
3- If all of this is true, you should do:
3.1 -> create the requestbuilder and point it to your file
3.2 -> you created your request passing a RequestCallback (see:
http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/http/client/RequestCallback.html
)
3.3 -> Inside the onResponseReceived of that call, you write the logic to
load and process your file.

This approach is much more complex but this have the advantage of not
blocking the browser.

Hope it helps,

-- 
André Moraes
Analista de Desenvolvimento de Sistemas
andr...@gmail.com
http://andredevchannel.blogspot.com/

-- 
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-tool...@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.



I need a little help with request builder

2010-08-16 Thread nacho
Well, the trouble is not exactly with request builder. The thing is
like this.

I have a class BinFileReader that in the constructor receives an url
an read it address file contents. And the class haves some methods,
like readString(), readInt, readByte, etc.

But, obviusly, first at all, to execute those methods, i need to have
the file readed using RequestBuilder, so when i execute this for
example:

BinFileReader fileReader = new BinFileReader("/mytext.txt");
String result = fileReader.readString(0, 10); // 0 = from, 10 = to

Could happen, and it happens, that the file is not allready readed,
and i don't have file contents, so readString method is not usefull.

My question, is, how could i build my BinFileReader so i dont have
this issue? Do i have to check if the file is readed, if don't put a
timer and try again, and over and over again till the file was readed?

-- 
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-tool...@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.



Request Builder Vs RPC call for File Download

2010-06-01 Thread Tapas Adhikary
Hi All,

I need a suggestion. I have requirement of downloading file from the server.
I am using GWT . Which one would be the best approach to send the request to
the server , RequestBuilder or RPC.
I have to send multiple report ids to the server. Based on the these report
Ids I need make a service call at the server side and get the OutputStream.

If I am using Request Builder ,
Approach 1 :
I can send all these report Ids as a comm separated string as a part of
the request data and then parse them in the servlet to make the service call
. But it's failing when I am trying to do
Wndow.location.assign(Servlet_name+"?"+requestdata);

Approach 2 :
  I can create a form and pass the Ids as a hiden parameter to servlet and
then leave it to the browser. I won't do any
explicit Wndow.location.assign(Servlet_name+"?"+requestdata);. As soon as My
servlet flush the OutputStream , browser should take care of that as the
OutputStream is sent as a part of response. No temp file being created here
. - This is working fine.

If I am using RPC call ,
 Straight forward RPC Call. In the Service IMPL I am creating a temp file in
the tmp folder and onSuccess() I am doing ,
  String baseURL = GWTServiceUtil.getContextPath() + result;
 Window.Location.assign(baseURL);
Th is working fine too..

Which one is the better among these too and why ?

Thanks in advance ,

- Tapas

-- 
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-tool...@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.



Re: request builder

2010-01-08 Thread ben fenster
the thing is there wasnt anything to tell because i used a reequest
builder wich sent requests ok in hosted but nor in compile
the problem was with the url  the problem is with the reequeest
builder class that for some reason didnt throw any exception  when it
considered the diffrence betwen 127.0.0.1 and localhose as a
violation  of sop policiy
so everything was working fine just without a response data

On Jan 8, 12:45 pm, Paul Robinson  wrote:
> Please don't take this the wrong way. I really am trying to help...
>
> If you read this:http://catb.org/~esr/faqs/smart-questions.html
>
> then you may understand why you've had a poor response and perhaps get
> some ideas about how to elicit a better response. For example, Jamie
> tried to help, but it's not clear from what you said whether you've
> looked at what is actually being sent over the network to the server
> using something like firebug or TamperData. You don't say what error you
> get, if any. You don't say whether and how the network traffic is
> different in dev and production mode. Unless you provide more details,
> and show that you're actually trying to work out what's happening,
> nobody else will either.
>
> HTH
> Paul
>
> ben fenster wrote:
> > ??
>
> > On Jan 7, 7:30 pm, ben fenster  wrote:
>
> >> thats what  i am doing and it works great in hosted but not in compile
> >> mode do you have an idea way ??
>
> >> On Jan 7, 3:55 pm, Jamie  wrote:
>
> >>> You should then probably install something like TamperData or Firebug
> >>> for firefox, and see if your request is actually being sent from the
> >>> browser.  Or you could use wireshark, but that's not as easy to read.
> >>> As well, tamperdata or wireshark will let you see the data in the
> >>> responses.
>
> >>> BTW, if you are running a separate PHP web server, firefox considers a
> >>> different port to be cross-site.
> >>> You can work around that by deploying your compiled javascript via the
> >>> PHP server, or you can use (eg) Apache to do proxy forwarding so the
> >>> browser thinks it is all one site.
>
> >>> On Jan 7, 5:51 am, ben fenster  wrote:
>
>  ???
>
>  On Jan 7, 11:56 am, ben fenster  wrote:
>
> > its not cross site and it works ok in hosted more over it doesnt fail
> > in compile but keep getting empty responses and in hosted they are ok
> > i cant understand why
>
> > On Jan 7, 10:47 am, olivier nouguier 
> > wrote:
>
> >> SOP ?
>
> >> or some GWT SOP
>
> >> All I known is that when using GWT-RPC the standard policy doesn't want
> >> cross webapp access!
>
> >> HIH
>
> >> On Thu, Jan 7, 2010 at 9:39 AM, ben fenster  
> >> wrote:
>
> >>> does any one know why would a request sent using equest builder works
> >>> in hosted mode  but dont work in compile mode i am using it to access
> >>> php scripts running on the same xamp server
>
> >>> --
> >>> 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-tool...@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.
>
> >> --
> >> A coward is incapable of exhibiting love; it is the prerogative of the
> >> brave.
> >> --
> >> Mohandas Gandhi
-- 
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-tool...@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.




Re: request builder

2010-01-08 Thread Paul Robinson
Please don't take this the wrong way. I really am trying to help...

If you read this:
http://catb.org/~esr/faqs/smart-questions.html

then you may understand why you've had a poor response and perhaps get
some ideas about how to elicit a better response. For example, Jamie
tried to help, but it's not clear from what you said whether you've
looked at what is actually being sent over the network to the server
using something like firebug or TamperData. You don't say what error you
get, if any. You don't say whether and how the network traffic is
different in dev and production mode. Unless you provide more details,
and show that you're actually trying to work out what's happening,
nobody else will either.

HTH
Paul

ben fenster wrote:
> ??
>
> On Jan 7, 7:30 pm, ben fenster  wrote:
>   
>> thats what  i am doing and it works great in hosted but not in compile
>> mode do you have an idea way ??
>>
>> On Jan 7, 3:55 pm, Jamie  wrote:
>>
>> 
>>> You should then probably install something like TamperData or Firebug
>>> for firefox, and see if your request is actually being sent from the
>>> browser.  Or you could use wireshark, but that's not as easy to read.
>>> As well, tamperdata or wireshark will let you see the data in the
>>> responses.
>>>   
>>> BTW, if you are running a separate PHP web server, firefox considers a
>>> different port to be cross-site.
>>> You can work around that by deploying your compiled javascript via the
>>> PHP server, or you can use (eg) Apache to do proxy forwarding so the
>>> browser thinks it is all one site.
>>>   
>>> On Jan 7, 5:51 am, ben fenster  wrote:
>>>   
 ???
 
 On Jan 7, 11:56 am, ben fenster  wrote:
 
> its not cross site and it works ok in hosted more over it doesnt fail
> in compile but keep getting empty responses and in hosted they are ok
> i cant understand why
>   
> On Jan 7, 10:47 am, olivier nouguier 
> wrote:
>   
>> SOP ?
>> 
>> or some GWT SOP
>> 
>> All I known is that when using GWT-RPC the standard policy doesn't want
>> cross webapp access!
>> 
>> HIH
>> 
>> On Thu, Jan 7, 2010 at 9:39 AM, ben fenster  
>> wrote:
>> 
>>> does any one know why would a request sent using equest builder works
>>> in hosted mode  but dont work in compile mode i am using it to access
>>> php scripts running on the same xamp server
>>>   
>>> --
>>> 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-tool...@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.
>>>   
>> --
>> A coward is incapable of exhibiting love; it is the prerogative of the
>> brave.
>> --
>> Mohandas Gandhi
>> 
-- 
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-tool...@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.




Re: request builder

2010-01-08 Thread ben fenster
??

On Jan 7, 7:30 pm, ben fenster  wrote:
> thats what  i am doing and it works great in hosted but not in compile
> mode do you have an idea way ??
>
> On Jan 7, 3:55 pm, Jamie  wrote:
>
> > You should then probably install something like TamperData or Firebug
> > for firefox, and see if your request is actually being sent from the
> > browser.  Or you could use wireshark, but that's not as easy to read.
> > As well, tamperdata or wireshark will let you see the data in the
> > responses.
>
> > BTW, if you are running a separate PHP web server, firefox considers a
> > different port to be cross-site.
> > You can work around that by deploying your compiled javascript via the
> > PHP server, or you can use (eg) Apache to do proxy forwarding so the
> > browser thinks it is all one site.
>
> > On Jan 7, 5:51 am, ben fenster  wrote:
>
> > > ???
>
> > > On Jan 7, 11:56 am, ben fenster  wrote:
>
> > > > its not cross site and it works ok in hosted more over it doesnt fail
> > > > in compile but keep getting empty responses and in hosted they are ok
> > > > i cant understand why
>
> > > > On Jan 7, 10:47 am, olivier nouguier 
> > > > wrote:
>
> > > > > SOP ?
>
> > > > > or some GWT SOP
>
> > > > > All I known is that when using GWT-RPC the standard policy doesn't 
> > > > > want
> > > > > cross webapp access!
>
> > > > > HIH
>
> > > > > On Thu, Jan 7, 2010 at 9:39 AM, ben fenster  
> > > > > wrote:
> > > > > > does any one know why would a request sent using equest builder 
> > > > > > works
> > > > > > in hosted mode  but dont work in compile mode i am using it to 
> > > > > > access
> > > > > > php scripts running on the same xamp server
>
> > > > > > --
> > > > > > 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-tool...@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.
>
> > > > > --
> > > > > A coward is incapable of exhibiting love; it is the prerogative of the
> > > > > brave.
> > > > > --
> > > > > Mohandas Gandhi
-- 
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-tool...@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.




Re: request builder

2010-01-07 Thread ben fenster
thats what  i am doing and it works great in hosted but not in compile
mode do you have an idea way ??

On Jan 7, 3:55 pm, Jamie  wrote:
> You should then probably install something like TamperData or Firebug
> for firefox, and see if your request is actually being sent from the
> browser.  Or you could use wireshark, but that's not as easy to read.
> As well, tamperdata or wireshark will let you see the data in the
> responses.
>
> BTW, if you are running a separate PHP web server, firefox considers a
> different port to be cross-site.
> You can work around that by deploying your compiled javascript via the
> PHP server, or you can use (eg) Apache to do proxy forwarding so the
> browser thinks it is all one site.
>
> On Jan 7, 5:51 am, ben fenster  wrote:
>
> > ???
>
> > On Jan 7, 11:56 am, ben fenster  wrote:
>
> > > its not cross site and it works ok in hosted more over it doesnt fail
> > > in compile but keep getting empty responses and in hosted they are ok
> > > i cant understand why
>
> > > On Jan 7, 10:47 am, olivier nouguier 
> > > wrote:
>
> > > > SOP ?
>
> > > > or some GWT SOP
>
> > > > All I known is that when using GWT-RPC the standard policy doesn't want
> > > > cross webapp access!
>
> > > > HIH
>
> > > > On Thu, Jan 7, 2010 at 9:39 AM, ben fenster  
> > > > wrote:
> > > > > does any one know why would a request sent using equest builder works
> > > > > in hosted mode  but dont work in compile mode i am using it to access
> > > > > php scripts running on the same xamp server
>
> > > > > --
> > > > > 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-tool...@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.
>
> > > > --
> > > > A coward is incapable of exhibiting love; it is the prerogative of the
> > > > brave.
> > > > --
> > > > Mohandas Gandhi
-- 
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-tool...@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.




Re: request builder

2010-01-07 Thread Jamie
You should then probably install something like TamperData or Firebug
for firefox, and see if your request is actually being sent from the
browser.  Or you could use wireshark, but that's not as easy to read.
As well, tamperdata or wireshark will let you see the data in the
responses.

BTW, if you are running a separate PHP web server, firefox considers a
different port to be cross-site.
You can work around that by deploying your compiled javascript via the
PHP server, or you can use (eg) Apache to do proxy forwarding so the
browser thinks it is all one site.

On Jan 7, 5:51 am, ben fenster  wrote:
> ???
>
> On Jan 7, 11:56 am, ben fenster  wrote:
>
> > its not cross site and it works ok in hosted more over it doesnt fail
> > in compile but keep getting empty responses and in hosted they are ok
> > i cant understand why
>
> > On Jan 7, 10:47 am, olivier nouguier 
> > wrote:
>
> > > SOP ?
>
> > > or some GWT SOP
>
> > > All I known is that when using GWT-RPC the standard policy doesn't want
> > > cross webapp access!
>
> > > HIH
>
> > > On Thu, Jan 7, 2010 at 9:39 AM, ben fenster  wrote:
> > > > does any one know why would a request sent using equest builder works
> > > > in hosted mode  but dont work in compile mode i am using it to access
> > > > php scripts running on the same xamp server
>
> > > > --
> > > > 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-tool...@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.
>
> > > --
> > > A coward is incapable of exhibiting love; it is the prerogative of the
> > > brave.
> > > --
> > > Mohandas Gandhi
-- 
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-tool...@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.




Re: request builder

2010-01-07 Thread ben fenster
???

On Jan 7, 11:56 am, ben fenster  wrote:
> its not cross site and it works ok in hosted more over it doesnt fail
> in compile but keep getting empty responses and in hosted they are ok
> i cant understand why
>
> On Jan 7, 10:47 am, olivier nouguier 
> wrote:
>
> > SOP ?
>
> > or some GWT SOP
>
> > All I known is that when using GWT-RPC the standard policy doesn't want
> > cross webapp access!
>
> > HIH
>
> > On Thu, Jan 7, 2010 at 9:39 AM, ben fenster  wrote:
> > > does any one know why would a request sent using equest builder works
> > > in hosted mode  but dont work in compile mode i am using it to access
> > > php scripts running on the same xamp server
>
> > > --
> > > 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-tool...@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.
>
> > --
> > A coward is incapable of exhibiting love; it is the prerogative of the
> > brave.
> > --
> > Mohandas Gandhi
-- 
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-tool...@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.




Re: request builder

2010-01-07 Thread ben fenster
its not cross site and it works ok in hosted more over it doesnt fail
in compile but keep getting empty responses and in hosted they are ok
i cant understand why

On Jan 7, 10:47 am, olivier nouguier 
wrote:
> SOP ?
>
> or some GWT SOP
>
> All I known is that when using GWT-RPC the standard policy doesn't want
> cross webapp access!
>
> HIH
>
>
>
> On Thu, Jan 7, 2010 at 9:39 AM, ben fenster  wrote:
> > does any one know why would a request sent using equest builder works
> > in hosted mode  but dont work in compile mode i am using it to access
> > php scripts running on the same xamp server
>
> > --
> > 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-tool...@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.
>
> --
> A coward is incapable of exhibiting love; it is the prerogative of the
> brave.
> --
> Mohandas Gandhi
-- 
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-tool...@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.




Re: request builder

2010-01-07 Thread olivier nouguier
SOP ?

or some GWT SOP

All I known is that when using GWT-RPC the standard policy doesn't want
cross webapp access!

HIH


On Thu, Jan 7, 2010 at 9:39 AM, ben fenster  wrote:

> does any one know why would a request sent using equest builder works
> in hosted mode  but dont work in compile mode i am using it to access
> php scripts running on the same xamp server
>
> --
> 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-tool...@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.
>
>
>
>


-- 
A coward is incapable of exhibiting love; it is the prerogative of the
brave.
--
Mohandas Gandhi
-- 

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-tool...@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.



request builder

2010-01-07 Thread ben fenster
does any one know why would a request sent using equest builder works
in hosted mode  but dont work in compile mode i am using it to access
php scripts running on the same xamp server
-- 
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-tool...@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.




Request Builder and SOP Policy

2009-08-20 Thread Hemal

Hi All,

I am  building an application where i need to access a service from
another domain and pass  POST parameter to it. i am using
RequestBuilder for the same.

The main use of the app would be to provide to many users so that they
can include the code and run it . Something like a widget.

when i try to access the URL from different domain , i am getting the
response as 0 due to SOP policy.

is there a way to curb this out?

-Hemal


P.S: its just a client side code so -noserver option would not work i
guess.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Request builder HTTP Method

2009-05-19 Thread Thomas Broyer



On 18 mai, 15:08, Arthik Babu  wrote:
> Hi,
>
>    In my task I need to build the request for the URL. I am getting
> Method as a parameter. I dont know how to get the http method name
> from the Method class. Please help me.

See http://groups.google.fr/group/Google-Web-Toolkit/msg/46fe128c6038e69b
to build a RequestBuilder with the method as a String rather than a
RequestBuilder.Method object.

But you could also just use, say a HashMap to map String to Method:

public static final Map HTTP_METHODS;

static {
   Map methods = new HashMap(2);
   methods.put("GET", RequestBuilder.GET);
   methods.put("POST", RequestBuilder.POST);
   HTTP_METHODS = Collections.unmodifiableMap(methods);
}

...

RequestBuilder builder = new RequestBuilder(HTTP_METHODS.get(method),
url);


or:

> For ex.
>
>   doProcess(URL url, Method method){

Don't you mean String instead of Method here?

> // here i need to check the HTTP method name
> like
>
> if(method.GET == "GET) or (method.getName() == GET){

if (RequestBuilder.GET.toString().equals(method)) {

>   RequestBuilder builder = new RequestBuilder(ReqestBuilder.GET,url);} else{
>
>  RequestBuilder builder = new RequestBuilder(ReqestBuilder.POST,url);
>
> }
> }


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Request builder HTTP Method

2009-05-18 Thread Arthik Babu

Hi,

   In my task I need to build the request for the URL. I am getting
Method as a parameter. I dont know how to get the http method name
from the Method class. Please help me.

For ex.

  doProcess(URL url, Method method){
// here i need to check the HTTP method name
like

if(method.GET == "GET) or (method.getName() == GET){
  RequestBuilder builder = new RequestBuilder(ReqestBuilder.GET,url);
} else{
 RequestBuilder builder = new RequestBuilder(ReqestBuilder.POST,url);
}
}

I need to know the HTTP method from the Method class. Else can you
suggest any other implementation??

Please help me.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Request Builder problem

2008-12-19 Thread Jason Essington

Request builder is behaving exactly as expected here ... You should  
read:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/faca1575f306ba0f/3be719c021aa19bd?pli=1

-jason

On Dec 14, 2008, at 12:32 AM, dhaval wrote:

>
> Hi guys,
> I have searched the forum and couldn't find the solution. Here is my
> code.
>
> public class Getter {
>   private String url = "php/Main.php";  //fix url never
> changes
>   private RequestBuilder builder = null;
>   private String result = null;
>
>   public Getter() {
>   builder = new RequestBuilder(RequestBuilder.POST, 
> URL.encode(url));
>
>   }
>
>   public String getData(int id, final String section){
>   String param = "nId=";
>   param += Integer.toString(id);
>   param +="&";
>   param +="sectionName=";
>   param += section;
>
>
>
>   builder.setHeader("Content-Type", "application/x-www-form-
> urlencoded");
>
>
>
>
>
>try {
>   builder.sendRequest(param,new RequestCallback(){
>
>
>   public void onError(Request request, 
> Throwable exception) {
>   calxx("error");
>
>
>   }
>
>
>   public void onResponseReceived(Request 
> request, Response
> response) {
>   calxx(response.getText());
>   
> Window.alert("-"+response.getText());
>   TemoStorage.temp = 
> response.getText();
>
>   }
>
>   });
>
>   } catch (RequestException e) {
>   // TODO Auto-generated catch block
>   e.printStackTrace();
>   }
>
>
>
>
>   GWT.log(TemoStorage.temp, null);
>   return TemoStorage.temp;
>
>   }
>
>   private void calxx(String kk){
>   result = kk;
>   }
>
>
>
>
> }
>
>
>
> TemoStorage.temp is static string field.
> now, when I call the method getData from the other class.  I get the
> window alert displaying the apropriat server message. But this method
> return null.  GWT log also says null.   How do I return apropriat
> "server message" with this method.
>
>
> Thanks
>
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Request Builder problem

2008-12-19 Thread Isaac Truett

You're making an asynchronous request and then you aren't waiting for
it to finish. Your getData() method cannot return anything.You have to
use the callback to do whatever it is you want done with the data.


On Sun, Dec 14, 2008 at 2:32 AM, dhaval  wrote:
>
> Hi guys,
> I have searched the forum and couldn't find the solution. Here is my
> code.
>
> public class Getter {
>private String url = "php/Main.php";  //fix url never
> changes
>private RequestBuilder builder = null;
>private String result = null;
>
>public Getter() {
>builder = new RequestBuilder(RequestBuilder.POST, 
> URL.encode(url));
>
>}
>
>public String getData(int id, final String section){
>String param = "nId=";
>param += Integer.toString(id);
>param +="&";
>param +="sectionName=";
>param += section;
>
>
>
>builder.setHeader("Content-Type", "application/x-www-form-
> urlencoded");
>
>
>
>
>
> try {
>builder.sendRequest(param,new 
> RequestCallback(){
>
>
>public void onError(Request request, 
> Throwable exception) {
>calxx("error");
>
>
>}
>
>
>public void onResponseReceived(Request 
> request, Response
> response) {
>calxx(response.getText());
>
> Window.alert("-"+response.getText());
>TemoStorage.temp = 
> response.getText();
>
>}
>
>});
>
>} catch (RequestException e) {
>// TODO Auto-generated catch block
>e.printStackTrace();
>}
>
>
>
>
>GWT.log(TemoStorage.temp, null);
>return TemoStorage.temp;
>
>}
>
>private void calxx(String kk){
>result = kk;
>}
>
>
>
>
> }
>
>
>
> TemoStorage.temp is static string field.
> now, when I call the method getData from the other class.  I get the
> window alert displaying the apropriat server message. But this method
> return null.  GWT log also says null.   How do I return apropriat
> "server message" with this method.
>
>
> Thanks
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Request Builder problem

2008-12-14 Thread dhaval

Hi guys,
I have searched the forum and couldn't find the solution. Here is my
code.

public class Getter {
private String url = "php/Main.php";  //fix url never
changes
private RequestBuilder builder = null;
private String result = null;

public Getter() {
builder = new RequestBuilder(RequestBuilder.POST, 
URL.encode(url));

}

public String getData(int id, final String section){
String param = "nId=";
param += Integer.toString(id);
param +="&";
param +="sectionName=";
param += section;



builder.setHeader("Content-Type", "application/x-www-form-
urlencoded");





 try {
builder.sendRequest(param,new RequestCallback(){


public void onError(Request request, 
Throwable exception) {
calxx("error");


}


public void onResponseReceived(Request 
request, Response
response) {
calxx(response.getText());

Window.alert("-"+response.getText());
TemoStorage.temp = 
response.getText();

}

});

} catch (RequestException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}




GWT.log(TemoStorage.temp, null);
return TemoStorage.temp;

}

private void calxx(String kk){
result = kk;
}




}



TemoStorage.temp is static string field.
now, when I call the method getData from the other class.  I get the
window alert displaying the apropriat server message. But this method
return null.  GWT log also says null.   How do I return apropriat
"server message" with this method.


Thanks

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Request Builder doesn't invoke the server (external)

2008-11-11 Thread Jason Essington

There is a very complete example of this in the book "Google Web  
Toolkit Applications" by Ryan Dewsbury

-jason

On Nov 11, 2008, at 6:05 AM, Manish Kumar wrote:

>
> Hi,
>
> Can anybody guide me anything simple to proxy the request at  
> server,since we
> have only this solution to follow.
> please provide if anybody is having script for this.
>
> Regards,
> Manish
>
> - Original Message -
> From: "Thomas Broyer" <[EMAIL PROTECTED]>
> To: "Google Web Toolkit" 
> Sent: Monday, November 10, 2008 9:42 PM
> Subject: Re: Request Builder doesn't invoke the server (external)
>
>
>
>
>
> On 10 nov, 16:20, "Manish Kumar" <[EMAIL PROTECTED]> wrote:
>>
>> PMRequestBuilder builder = new PMRequestBuilder
>> ("PUT","http://10.19.74.129:8000/pm/pubmodel.jsp?path=comments";);
> [...]
>> Can anybody please help me to find out the mistake.
>
> http://en.wikipedia.org/wiki/Same_origin_policy
>
> You just cannot contact another "origin" from the one the script/page
> originates from; you'll have to proxy the request at your own server.
>
>
> >


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Request Builder doesn't invoke the server (external)

2008-11-11 Thread Manish Kumar

Hi,

Can anybody guide me anything simple to proxy the request at server,since we 
have only this solution to follow.
please provide if anybody is having script for this.

Regards,
Manish

- Original Message - 
From: "Thomas Broyer" <[EMAIL PROTECTED]>
To: "Google Web Toolkit" 
Sent: Monday, November 10, 2008 9:42 PM
Subject: Re: Request Builder doesn't invoke the server (external)





On 10 nov, 16:20, "Manish Kumar" <[EMAIL PROTECTED]> wrote:
>
> PMRequestBuilder builder = new PMRequestBuilder
> ("PUT","http://10.19.74.129:8000/pm/pubmodel.jsp?path=comments";);
[...]
> Can anybody please help me to find out the mistake.

http://en.wikipedia.org/wiki/Same_origin_policy

You just cannot contact another "origin" from the one the script/page
originates from; you'll have to proxy the request at your own server.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Request Builder doesn't invoke the server (external)

2008-11-10 Thread Thomas Broyer



On 10 nov, 16:20, "Manish Kumar" <[EMAIL PROTECTED]> wrote:
>
>             PMRequestBuilder builder = new PMRequestBuilder
> ("PUT","http://10.19.74.129:8000/pm/pubmodel.jsp?path=comments";);
[...]
> Can anybody  please help me to find out the mistake.

http://en.wikipedia.org/wiki/Same_origin_policy

You just cannot contact another "origin" from the one the script/page
originates from; you'll have to proxy the request at your own server.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Request Builder doesn't invoke the server (external)

2008-11-10 Thread Manish Kumar

Hi Everybody,

As I have used request builder to make an request to server, this does not 
even connect to server.

Here is my code :
public class CommentProviderServlet extends RemoteServiceServlet implements 
AddCommentService

{

private class PMRequestBuilder extends RequestBuilder

{

public PMRequestBuilder(String httpMethods,String url)

{

super(httpMethods,url);

 }

}


public String makeFiles( String destination, String commentText )

{

try

{

PMRequestBuilder builder = new PMRequestBuilder 
("PUT","http://10.19.74.129:8000/pm/pubmodel.jsp?path=comments";);


Request request = builder.sendRequest(null, new 
RequestCallback()

{

public void onError(Request request, Throwable exception)

{


System.out.println( exception.getMessage() );

}

public void onResponseReceived(Request request, Response 
response)

{


if (200 == response.getStatusCode())

{

System.out.println( response.getStatusCode() );

}

else

{

System.out.println( response.getStatusCode());

}

}

});


builder.setRequestData(commentText);

builder.send();

}

catch (RequestException e)

{

// Couldn't connect to server

e.printStackTrace();

 }


 return "File Saved.";

}

}

Can anybody  please help me to find out the mistake.

Thanx in advance

Manish



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Http Request Method PUT in GWT Request Builder

2008-10-22 Thread Thomas Broyer



On 22 oct, 17:01, Lothar Kimmeringer <[EMAIL PROTECTED]> wrote:
> Thomas Broyer schrieb:
>
> > AFAIK, this is a Safari-2-only limitation; but there are also broken
> > proxies/firewalls out there that only allows HEAD/GET/POST.
>
> A day without learning something new is a bad day. Today
> is a good day ;-)

Well, actually, reading the Javadoc for RequestBuilder is enough to
find the info about Safari ;-)
http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/http/client/RequestBuilder.html
(with a link to a bug that's been closed in early 2006)

As for the firewalls, I've heard about it on the atom-protocol WG,
from a GData developper. You can find it in their doc too:
http://code.google.com/apis/gdata/basics.html
"If your firewall does not allow PUT, then do an HTTP POST and set the
method override header as follows"
"If your firewall does not allow DELETE, then do an HTTP POST and set
the method override header as follows"

See also 
http://www.pluralsight.com/community/blogs/dbox/archive/2007/01/16/45725.aspx

> > However, I'd first check that the server accepts some kind of "method
> > override" (actually "tunneling" an HTTP method into a POST). What
> > strikes me is that you're talking about sending files with a
> > RequestBuilder !?
>
> Actually that didn't strike me at all. Think of a WebEDI-application.
> With GWT it's quite easy to create the EDIFACT-message on the client
> and send it directly to the processing server.

I wouldn't call it a "file" then.
When I read "sending a file", I understand that I have a file (on the
file system) whose data I want to send (maybe along with its name
too), not that I have some data (that might appear being something
usually stored in files, but is just "some data") that I want to send.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Http Request Method PUT in GWT Request Builder

2008-10-22 Thread Lothar Kimmeringer

Thomas Broyer schrieb:
> 
> AFAIK, this is a Safari-2-only limitation; but there are also broken
> proxies/firewalls out there that only allows HEAD/GET/POST.

A day without learning something new is a bad day. Today
is a good day ;-)

> However, I'd first check that the server accepts some kind of "method
> override" (actually "tunneling" an HTTP method into a POST). What
> strikes me is that you're talking about sending files with a
> RequestBuilder !?

Actually that didn't strike me at all. Think of a WebEDI-application.
With GWT it's quite easy to create the EDIFACT-message on the client
and send it directly to the processing server. Personally I would
do that via a RemoteServiceServlet just to be able to log that. Other-
wise it's hard to prove that e.g. an invoice received the trading
partner etc. But there might be other scenarios where that's not
necessary allowing to reduce the load of the server that way.


Regards, Lothar

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Http Request Method PUT in GWT Request Builder

2008-10-22 Thread Thomas Broyer


On 22 oct, 14:39, Lothar Kimmeringer <[EMAIL PROTECTED]> wrote:
> Manish Kumar schrieb:
>
> > Right now, I am completely stuck off at on point. I have a web server which
> > uploads the file using PUT method only. We have to put the file from GWT
> > (using RequestBuilder) client to webserver.
>
> > At this point of time, this is quite problematic to change the server
> > functionalities.
>
> > As the GWT doesn't suppport PUT method,We are completely stuck off
>
> The reason why GWT don't support PUT is simply because the browser
> (the GWT-application is relying on) don't support that in general.

AFAIK, this is a Safari-2-only limitation; but there are also broken
proxies/firewalls out there that only allows HEAD/GET/POST.

> > Can anybody please help me out to get the idea for providing the
> > implementation of PUT method in GWT by any means.

Pretty easy actually: use the protected constructor of
RequestBuilder !

   rb = new RequestBuilder("PUT", url) { /* nothing to add or override
*/ };

However, I'd first check that the server accepts some kind of "method
override" (actually "tunneling" an HTTP method into a POST). What
strikes me is that you're talking about sending files with a
RequestBuilder !?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Http Request Method PUT in GWT Request Builder

2008-10-22 Thread Lothar Kimmeringer

Manish Kumar schrieb:

> Right now, I am completely stuck off at on point. I have a web server which 
> uploads the file using PUT method only. We have to put the file from GWT 
> (using RequestBuilder) client to webserver.
> 
> At this point of time, this is quite problematic to change the server 
> functionalities.
> 
> As the GWT doesn't suppport PUT method,We are completely stuck off

The reason why GWT don't support PUT is simply because the browser
(the GWT-application is relying on) don't support that in general.

> Can anybody please help me out to get the idea for providing the 
> implementation of PUT method in GWT by any means.

You can write a RemoteServiceServlet that is doing the PUT-request
using a HttpClient or the plain HttpUrlConnection of Java.

You can load a Java-Applet that is doing the PUT-request (using the
already mentioned HttpUrlConnection). I'm not sure but this might
even work without signing the applet as long as the PUT-request
goes to the same server, the applet has been loaded from.


Regards, Lothar

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Http Request Method PUT in GWT Request Builder

2008-10-22 Thread Manish Kumar

Hi Everybody,

Thanks all of you for continuous help and support.

I have been working on gwt for 1 months back. I have learnt a lot from this 
Forum.

Right now, I am completely stuck off at on point. I have a web server which 
uploads the file using PUT method only. We have to put the file from GWT 
(using RequestBuilder) client to webserver.

At this point of time, this is quite problematic to change the server 
functionalities.

As the GWT doesn't suppport PUT method,We are completely stuck off

Can anybody please help me out to get the idea for providing the 
implementation of PUT method in GWT by any means.

Thanks
Manish
---
 Hi experts,
> When i tried to load image form another folder
> in public say images, its not loading and showing error like Resource
> images/myimage.jpg not
> found.
> I have given like
> ResourcesInterface extends ImmutableResourceBundle
> {
>
> /** @gwt.resource images/myjpg.jpg */
> public DataResource background();
>
>
>
> }
>
> its working fine when i put that image where source code lies.
>
> Could you please direct me where I'm wrong
>
> Thanks in advance
> Zujee
> > 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---