Saturday, March 31, 2012

call google places service error:invalid label:“html_attributions”

This question has been asked here(and several other places): google
places api error with jquery ajax call... html_attributions same as his
case,I can see response coming back fine in firbug's json tab,and
difference is I do add "callback",but still I got this error,this is my
code:

public native static void getJson(int requestId, AroundInfoHandler
handler) /*-{
var callback = "callback" + requestId;
// [1] Create a script element.
var script = document.createElement("script");
script.setAttribute("src",
"https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=myKey"+callback);
script.setAttribute("type", "text/javascript");

// [2] Define the callback function on the window object.
window[callback] = function(jsonObj) {
// [3]
console.log("Succeed to call google places service");
console.log(jsonObj);
//call java method here
window[callback + "done"] = true;
}

// [4] JSON download has 1-second timeout.
setTimeout(function() {
if (!window[callback + "done"]) {
console.log("Failed to call google places service");
//call java method here;
}

// [5] Cleanup. Remove script and callback elements.
document.body.removeChild(script);
delete window[callback];
delete window[callback + "done"];
}, 1000);

// [6] Attach the script element to the document body.
document.body.appendChild(script);
}-*/;
Even change window/document to $wnd/$doc,same problem as before,Can
anybody help me?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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: Quantify GWT Debug module overhead

Thomas,

I've long wondered how the UiBinder attachment process was done. I've read here before that temporary id's were used to swap elements in and out, and it made sense.

The UiBinder docs also hint at this:
 You know that when your ui is built, a getElementById() call is made for each and every one of them. In a large page, that can add up.

Since it's Saturday, and Googling found nothing for this enigma, I dug into the UiBinder source. Most of the meat is in UiBinderGenerator and UiBinderWriter:
/** * Declare a variable that will be filled at runtime with a unique id, safe * for use as a dom element's id attribute. For {@code UiRenderer} based code, * elements corresponding to a ui:field, need and id initialized to a value * that depends on the {@code fieldName}. For all other cases let * {@code fieldName} be {@code null}. * * @param fieldName name of the field corresponding to this variable. * @return that variable's name. */ public String declareDomIdHolder(String fieldName) throws UnableToCompleteException { String domHolderName = "domId" + domId++; FieldWriter domField = fieldManager.registerField(FieldWriterType.DOM_ID_HOLDER, oracle.findType(String.class.getName()), domHolderName); if (isRenderer && fieldName != null) { domField.setInitializer("buildInnerId(\"" + fieldName + "\", uiId)"); } else { domField.setInitializer("com.google.gwt.dom.client.Document.get().createUniqueId()"); } return domHolderName; 
  } 
Given that I don't see id's in the finished browser elements, they must have been removed out, but I cannot be sure since the Run Time debugger does not allow peeking into the generator (rebinder) code. Not sure why UiBinder could not just hold on to the node reference of the insertion point, but browsers do funny things when you're ramming a ton of HTML in and you sometimes need to be asynchronous about it. 

Also, to the matter of using id's, you can, but not if the element has a field name too, however id's are now deprecated. The compiler code calls this an OldSchoolId in UiBinderWriter. Frankly I say never use an id in UiBinder, or other generated widget code, since id's are supposed to be unique and stamping out widgets with the same id just messes up your DOM.


As to the debugId not working in GWT 2.4. One of my project uses debugId attributes in the ui.xml files extensively. When I tried to upgrade to 2.4, compile kept giving errors that "debugId" was not a legal attribute for various HTML elements. My assumption is that such attributes were not vetted before 2.4. I'm not sure why vetting is now done after five years, but the HTML spec allows anything you want in there and the browser is supposed to ignore invalid values, hence why debugId works in browsers. It would be nice if "debugId" could be a whitelisted attribute.


Please if anyone else knows better how this work, do sing out.

Sincerely,
Joseph

--
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/-/kJyTouH4Pb8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: CustomScrollPanel issue (extra div overlays generated impacting performance?)

Hi Seth,

I copied your classes and css in my client package. It compiled fine.
When i run the applicatio in dev mode, the browser default scrollbar is not overridden.

It is same as default.

What can i do to override the native one ?

On Sun, Apr 1, 2012 at 1:05 AM, Deepak Singh <deepaksingh.kr@gmail.com> wrote:
Thank you Seth. I would give it a try.

Thats already reposted and is in the thread.

Thanks
Deepak


On Sat, Mar 31, 2012 at 10:59 PM, GWTter <seth.gwt@gmail.com> wrote:
Hi Deepak,

This is all that's in the css file as the only important class is the corner that I've set to be transparent:

.customScrollPanel{
}

.customScrollPanelCorner{
    opacity: 0.0;
}

As for how to use the vertical scroll bar to override the native (or the transparent one CustomScrollPanel uses by default) if you look at the line

"this.setVerticalScrollbar(new MyVerticalScrollBar(),MyVerticalScrollBar.getScrollBarWidth());"

in MyScrollPanel class in the code I sent, this is what actually does the overriding. This method is available on the CustomScrollPanel class which MyScrollPanel extends.

Hope that answers your question. Also can you please repost my initial reply with the code to this thread, it would save me the time of having to rewrite it :) Thanks.


-Seth

--
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/-/g-x4PrKzgjoJ.

To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh



--
Deepak Singh

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: CustomScrollPanel issue (extra div overlays generated impacting performance?)

Thank you Seth. I would give it a try.

Thats already reposted and is in the thread.

Thanks
Deepak

On Sat, Mar 31, 2012 at 10:59 PM, GWTter <seth.gwt@gmail.com> wrote:
Hi Deepak,

This is all that's in the css file as the only important class is the corner that I've set to be transparent:

.customScrollPanel{
}

.customScrollPanelCorner{
    opacity: 0.0;
}

As for how to use the vertical scroll bar to override the native (or the transparent one CustomScrollPanel uses by default) if you look at the line

"this.setVerticalScrollbar(new MyVerticalScrollBar(),MyVerticalScrollBar.getScrollBarWidth());"

in MyScrollPanel class in the code I sent, this is what actually does the overriding. This method is available on the CustomScrollPanel class which MyScrollPanel extends.

Hope that answers your question. Also can you please repost my initial reply with the code to this thread, it would save me the time of having to rewrite it :) Thanks.


-Seth

--
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/-/g-x4PrKzgjoJ.

To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Referencing a GWT project from another - CreateProcess error=206, The filename or extension is too long

I am already using an open source GWT project (iServe) and I would like to integrate into it another open source GWT project (PetalsBPM), by which I mean being able to call it and reference its methods.

Both projects (which include multiple modules) have been imported  into Eclipse successfully, but whenever I try to add a specific PetalsBPM module (the one containing its entrypoint) to iServe through Properties -> Java Build Path -> Projects, although it does not cause any errors immediately, I cannot launch iServe anymore. It produces the following error:

"Exception occurred executing command line. Cannot run program "C:\Program Files\Java\jre7\bin\javaw.exe" (in directory "C:...iserve-sal-gwt-1.0.0-SNAPSHOT"): CreateProcess error=206, The filename or extension is too long"

 

Trying to figure out the source of this error, I attempted to simplify the problem, so I performed the following moves:

  1. I created two new simple GWT projects and tried to reference one from the other. Worked fine
  2. I referenced the module I actually want to use (PetalsBPM) from the simple one I just created. Also works fine.
  3. I referenced the new simple project from the original one I want to use (iServe). Also works fine.
  4. Tried referencing a different module of the PetalsBPM project, and it still does not produce this error (with some modules it runs without any errors, with others it produces errors that are different and fixable).
  5. Finally, I tried switching workspaces. I created a new workspace in C:\, and moved the actual projects there, in case the filenames were indeed too long. Still it did not work. :(

 

Based on the above, I 'm guessing that the problem is that each of the modules I m trying to integrate is based on many other modules, so their "sum" ends up too big. But I don't know how to fix such a problem.

I have read elsewhere to try and set java forking to false, and disable enhancements, but I don't know how to do the first or if it would help, and my project does not use Google's AppEngine (or ORM)

Any help would be appreciated! 

--
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/-/UQzNFUPv0TkJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: GWT - Adding modules from 2.4 to 2.1

gwt-user from one version should generally be used with the gwt-dev of the same version, however there are many things in gwt-user that could work with other versions of gwt-dev, so you can extract the module you want from gwt-user 2.4 and add it to your project (or another JAR that you add as a dependency), and see if it works.

I'd strongly suggest that you always upgrade to the latest version of GWT though.

On Saturday, March 31, 2012 6:42:17 PM UTC+2, apanizo wrote:
Hi Joseph,

thank you for your answer.

Finally I used other framework that works on 2.1 but I´m still interested for the future.

If I understood you correctly you mean that  I must download the code of gwt 2.1, add the code of the validation module, and then, compile it using ant. Is that correct?

The only thing that I don´t understand when you said "facets". Did you mean this?

Thank you in advance,

Adolfo. 

2012/3/30 Joseph Lust <lifeoflust@gmail.com>
Do the projects you want to include depend on facets of GWT 2.4? Can you just download the src and build them using GWT 2.1, and then include that in your GWT 2.1 project?

Sincerely,
Joe

--
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/-/0-HBORAXV8sJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
El precio es lo que pagas. El valor es lo que recibes.
Warren Buffet

--
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/-/CvOIZoEibOoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: CustomScrollPanel issue (extra div overlays generated impacting performance?)

Hi Deepak,

This is all that's in the css file as the only important class is the corner that I've set to be transparent:

.customScrollPanel{
}

.customScrollPanelCorner{
    opacity: 0.0;
}

As for how to use the vertical scroll bar to override the native (or the transparent one CustomScrollPanel uses by default) if you look at the line

"this.setVerticalScrollbar(new MyVerticalScrollBar(),MyVerticalScrollBar.getScrollBarWidth());"

in MyScrollPanel class in the code I sent, this is what actually does the overriding. This method is available on the CustomScrollPanel class which MyScrollPanel extends.

Hope that answers your question. Also can you please repost my initial reply with the code to this thread, it would save me the time of having to rewrite it :) Thanks.

-Seth

--
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/-/g-x4PrKzgjoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: GWT - Adding modules from 2.4 to 2.1

Hi Joseph,

thank you for your answer.

Finally I used other framework that works on 2.1 but I´m still interested for the future.

If I understood you correctly you mean that  I must download the code of gwt 2.1, add the code of the validation module, and then, compile it using ant. Is that correct?

The only thing that I don´t understand when you said "facets". Did you mean this?

Thank you in advance,

Adolfo. 

2012/3/30 Joseph Lust <lifeoflust@gmail.com>
Do the projects you want to include depend on facets of GWT 2.4? Can you just download the src and build them using GWT 2.1, and then include that in your GWT 2.1 project?

Sincerely,
Joe

--
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/-/0-HBORAXV8sJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
El precio es lo que pagas. El valor es lo que recibes.
Warren Buffet

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: GWT 2.5 and beyond

I use TeamCity to build each GWT trunk commit. For example there were four commits yesterday to the GWT trunk to add ARIA accessibility support. So yes, they're still in the game.

Sincerely,
Joe

--
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/-/ECmPpsCsqT4J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: GWT 2.5 and beyond


On Saturday, March 31, 2012 4:00:56 PM UTC+2, supercobra wrote:
The GWT PR machine has been offline for a year now. As it seems, the GWT engineers have been either working hard on a big and long project that is going to blow our socks off and hopefully they'll unveil it at Google IO 2012 or Google is winding down the project which would be a huge pity. The event that got me worried a lot is when their developer relation engineer David Chandler was moved to another group. David's blog: http://turbomanage.wordpress.com/
So far I have not heard of the name of his replacement.

Google should we worry or get excited?

Let's get excited: https://plus.google.com/u/0/110412141990454266397/posts/Nvr6Se6eAPh ! 

--
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/-/6ErvHdAEBacJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: GWT 2.5 and beyond

The GWT PR machine has been offline for a year now. As it seems, the GWT engineers have been either working hard on a big and long project that is going to blow our socks off and hopefully they'll unveil it at Google IO 2012 or Google is winding down the project which would be a huge pity. The event that got me worried a lot is when their developer relation engineer David Chandler was moved to another group. David's blog: http://turbomanage.wordpress.com/
So far I have not heard of the name of his replacement.

Google should we worry or get excited?


--
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/-/XCHipmLjMW8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: Using Hangout API in GWT

This is why the xsiframe linker is for (and previously, the xs linker, which is now deprecated); simply add that to your gwt.xml:
<add-linker name="xsiframe" />
See https://developers.google.com/web-toolkit/doc/latest/FAQ_Server#What_is_the_Same_Origin_Policy,_and_how_does_it_affect_GWT?

On Saturday, March 31, 2012 9:50:39 AM UTC+2, Sea wrote:
I am in the middle of a problem to add Hangout API into my collaboration web application written in GWT.
Since Hangout API only allows to be run on only http://plus.google.com domain,
the GWT compiled javascript which hosted on my domain can not be injected into a hangout instance by the GWT's script iframe injection method due to security rule of browsers.
For illustration,  The following is a sample web app at http://kobkrit-salang.appspot.com.

The gray hilight text at the half-bottom of the screen is the iframe added by GWT to inject the compiled Javascript.


I using the following XML file for Hangout API


When running it with Hangout instance, My web application could not be run, it encounters with the following problem.


4Unsafe JavaScript attempt to access frame with URL https://6nlt194vs7651884mb611iih4ren87ah-a-hangout-opensocial.googleusercontent.com/gadgets/ifr?url=app%3A//711346462244/hangout&container=hangout&view=default&lang=all&country=ALL&debug=0&nocache=1&sanitize=0&v=f8dd7cb5420f9259&testmode=0&parent=https%3A//hangoutsapi.talkgadget.google.com&mid=0&authuser=0&hl=en#st=e%3DABul2V1sl1lc6NLQxflEyV%252BvhFi%252Fe3nCEI4bJ%252Bqw7leMqzl7%252Fp5rg8QD5koyJ%252FmsyzhSz8wDU%252BT0txZz6SS%252BvCBjnOW3yG9YMYqFnCQduW9yng5%252FyVflXcAGyBEsld%252FK%252BtJ5otg9ocz4%26c%3Dhangout from frame with URL https://kobkrit-salang.appspot.com/simplegwt/9649FA6CE155A9D18D7B7F35499CCDCC.cache.html. Domains, protocols and ports must match.


Without iframe method, Is there is method in GWT to change the way to injecting its javascript file? 
or There are any methods to solve this? It is very appreciated.


Thank you very much!

Kobkrit Viriryayudakorn 


--
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/-/xhtWi1B83C8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: GWT Development Mode detailed nocache.js

DevMode has no -style argument, but Compiler has. You can also have a look at the *.js files in com/google/gwt/core/linker/ in the gwt-dev.jar for the templates used by each linker (by default, the IFrameLinker is used)

On Wednesday, March 21, 2012 7:06:05 PM UTC+1, YvetteT wrote:
Hi,

is it possible to get pretty javascript for the generated *.nocache.js using eclipse?

Because the DevMode debug config itself refuses to accept -style DETAILED if specified using the arguments list.

Thanks

--
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/-/Gm7BsaDTK74J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Using Hangout API in GWT

I am in the middle of a problem to add Hangout API into my collaboration web application written in GWT.
Since Hangout API only allows to be run on only http://plus.google.com domain,
the GWT compiled javascript which hosted on my domain can not be injected into a hangout instance by the GWT's script iframe injection method due to security rule of browsers.
For illustration,  The following is a sample web app at http://kobkrit-salang.appspot.com.

The gray hilight text at the half-bottom of the screen is the iframe added by GWT to inject the compiled Javascript.


I using the following XML file for Hangout API


When running it with Hangout instance, My web application could not be run, it encounters with the following problem.


4Unsafe JavaScript attempt to access frame with URL https://6nlt194vs7651884mb611iih4ren87ah-a-hangout-opensocial.googleusercontent.com/gadgets/ifr?url=app%3A//711346462244/hangout&container=hangout&view=default&lang=all&country=ALL&debug=0&nocache=1&sanitize=0&v=f8dd7cb5420f9259&testmode=0&parent=https%3A//hangoutsapi.talkgadget.google.com&mid=0&authuser=0&hl=en#st=e%3DABul2V1sl1lc6NLQxflEyV%252BvhFi%252Fe3nCEI4bJ%252Bqw7leMqzl7%252Fp5rg8QD5koyJ%252FmsyzhSz8wDU%252BT0txZz6SS%252BvCBjnOW3yG9YMYqFnCQduW9yng5%252FyVflXcAGyBEsld%252FK%252BtJ5otg9ocz4%26c%3Dhangout from frame with URL https://kobkrit-salang.appspot.com/simplegwt/9649FA6CE155A9D18D7B7F35499CCDCC.cache.html. Domains, protocols and ports must match.


Without iframe method, Is there is method in GWT to change the way to injecting its javascript file? 
or There are any methods to solve this? It is very appreciated.


Thank you very much!

Kobkrit Viriryayudakorn 


--
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/-/RXabfwELZGoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Friday, March 30, 2012

Re: JSNI error when using GWT canvas

I have exactly the same issue. Hope this is related to the development
mode and not to the production mode.

On 3 fév, 15:39, Karel <karel.cromb...@gmail.com> wrote:
> Hey guys,
>
> I am getting quite random internal GWT errors when I am using the GWT
> canvas widget in complex cases. Sometimes, seemingly random, JSNI
> errors are fired such as:
>
> com.google.gwt.dev.shell.HostedModeException: Something other than an
> int was returned from JSNI method
> '...@com.google.gwt.dom.client.CanvasElement::getWidth()': JS value of
> type JavaScript object(20511), expected int
>         at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:
> 266)
>         at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
>         at
> com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt(ModuleSpace.java:
> 247)
>         at
> com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java :
> 75)
>         at com.google.gwt.dom.client.CanvasElement$.getWidth$
> (CanvasElement.java)
>         at
> com.google.gwt.canvas.client.Canvas.getCoordinateSpaceWidth(Canvas.java:
> 127)
>          at...
>
> These errors occur quite often, but do not seem to break anything.
> They usually originate from a getCoordinateSpaceHeight() call on the
> canvas. I tried digging in the debugger to find out what's wrong, but
> the debugger does not cross the JSNI boundary, so I can't see what's
> going on in javascript.
>
> Anyone got any idea what is causing these errors?

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: GWT and how to make them better.

Got it working in another project where I'm using gwt 2.4 stable.

Server side works like a charm and browser side works pretty good. 

When editing ui.xml files it doesn't know what classes to reload(regenerate), that would be great if it could detect the uibinder related class and regenerate it (I spend a lot of time working on ui.xml files)

 Gwt trunk support will be also cool to have.

I may sound like I'm complaining, but I'm amazed... the server side alone already worth my money.

Keep up the good work!

On Fri, Mar 30, 2012 at 10:32 PM, Gal Dolber <gal.dolber@gmail.com> wrote:
Hi Bogo,

Finally decided to get JRebel, but I'm getting this exception:

java.lang.ClassCastException: com.google.gwt.dev.javac.CompilationState cannot be cast to org.zeroturnaround.jrebel.integration.gwt.cbp.CompilationStateInterface

Does JRebel support gwt trunk? or only the last stable version?
Thanks!

On Fri, Mar 30, 2012 at 4:21 PM, Harpal Grover <harpal.grover@gmail.com> wrote:
This is very cool.
--
Harpal Grover
President
Harpal Grover Consulting LLC

On Fri, Mar 30, 2012 at 7:33 AM, Bogo <shopov.bogomil@gmail.com> wrote:
Hey guys,
We just published an article on our blog about GWT and will be happy
to read your thoughts about it.
Here it is: http://j.mp/gwtgwtgwt

Happy hacking,
//Bogo

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/







--
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/




--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: GWT and how to make them better.

Hi Bogo,

Finally decided to get JRebel, but I'm getting this exception:

java.lang.ClassCastException: com.google.gwt.dev.javac.CompilationState cannot be cast to org.zeroturnaround.jrebel.integration.gwt.cbp.CompilationStateInterface

Does JRebel support gwt trunk? or only the last stable version?
Thanks!

On Fri, Mar 30, 2012 at 4:21 PM, Harpal Grover <harpal.grover@gmail.com> wrote:
This is very cool.
--
Harpal Grover
President
Harpal Grover Consulting LLC

On Fri, Mar 30, 2012 at 7:33 AM, Bogo <shopov.bogomil@gmail.com> wrote:
Hey guys,
We just published an article on our blog about GWT and will be happy
to read your thoughts about it.
Here it is: http://j.mp/gwtgwtgwt

Happy hacking,
//Bogo

--
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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/




--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: ajax-crawling approach to make gwt app crawlable works on default gwt example, but not on my app

Hi,
To answer both your replies. Yes, they do conform to the
specification. I also added the meta tag in the html (thought I forgot
to include that in the list of changes I did in the OP).
The problem isn't the HtmlUnit, because it simply doesn't get that
far. The filter is never run with the GET requests, only the requests
for the rpc service, therefore HtmlUnit doesn't get to be used.

On Mar 30, 8:40 pm, Ovidiu Mihaescu <gand...@gmail.com> wrote:
> Also, fromhttp://support.google.com/webmasters/bin/answer.py?hl=en&answer=174993,
> towards the bottom of the page:
> ...
> I'm using HtmlUnit as the headless browser, and it doesn't work. Why not?
> If "doesn't work" means that HtmlUnit does not return the snapshot you
> were expecting to see, it's very likely that the culprit is that you
> didn't give it enough time to execute the JavaScript and/or XHR
> requests. To fix this, try any or all of the following:
>    - Use NicelyResynchronizingAjaxController. This will cause HtmlUnit
> to wait for any outstanding XHR calls.
>    - Bump up the wait time for waitForBackgroundJavaScript and/or
> waitForBackgroundJavaScriptStartingBefore.
>
>
>
>
>
>
>
> On Fri, Mar 30, 2012 at 12:37 PM, Ovidiu Mihaescu <gand...@gmail.com> wrote:
> > Does your existing app's URLs conform to the spec at
> >https://developers.google.com/webmasters/ajax-crawling/docs/specifica...
> > ? More specifically, do all your history tokens start with an
> > exclamation mark?
>
> > On Fri, Mar 30, 2012 at 9:31 AM, erebrus <ereb...@gmail.com> wrote:
> >> Hi all,
> >> I was readinghttps://developers.google.com/webmasters/ajax-crawling/
> >> on how to make ajax apps (consequently gwt apps) crawlable.
> >> I took the code from google (summarized in point 3 of "How to create
> >> an HTML snapshot?" to create a filter (that returns html from ajax
> >> using HtmlUnit) and changed the web.xml accordingly. I created a new
> >> GWT project with example code and applied the filter and the web.xml
> >> there. It worked directly.
> >> However, I did exactly the same on the gwt app I want to make
> >> searchable and it doesn't work. For some reason, the only requests the
> >> filter gets are the ones to the ones for the rpc.
> >> I think I must be missing a terribly simple detail, but I'm a bit lost
> >> on where to go from here.
>
> >> Following you can see the code for the filter (CrawlServlet) and the
> >> web.xml
>
> >> package crawltest.server;
>
> >> import com.gargoylesoftware.htmlunit.BrowserVersion;
> >> import com.gargoylesoftware.htmlunit.WebClient;
> >> import com.gargoylesoftware.htmlunit.html.HtmlPage;
>
> >> import java.io.IOException;
> >> import java.io.PrintWriter;
> >> import java.io.UnsupportedEncodingException;
> >> import java.net.URLDecoder;
> >> import java.util.logging.Logger;
>
> >> import javax.servlet.Filter;
> >> import javax.servlet.FilterChain;
> >> import javax.servlet.FilterConfig;
> >> import javax.servlet.ServletException;
> >> import javax.servlet.ServletRequest;
> >> import javax.servlet.ServletResponse;
> >> import javax.servlet.http.HttpServletRequest;
> >> import javax.servlet.http.HttpServletResponse;
>
> >> /**
> >>  * Servlet that makes this application crawlable
> >>  */
> >> public final class CrawlServlet implements Filter {
>
> >>        private static final Logger logger =
> >> Logger.getLogger(CrawlServlet.class
> >>                        .getName());
> >>  private static String rewriteQueryString(String queryString) throws
> >> UnsupportedEncodingException {
> >>    StringBuilder queryStringSb = new StringBuilder(queryString);
> >>    int i = queryStringSb.indexOf("&_escaped_fragment_");
> >>    if (i != -1) {
> >>      StringBuilder tmpSb = new
> >> StringBuilder(queryStringSb.substring(0, i));
> >>      tmpSb.append("#!");
> >>      tmpSb.append(URLDecoder.decode(queryStringSb.substring(i + 20,
> >> queryStringSb.length()),"UTF-8"));
> >>      queryStringSb = tmpSb;
> >>    }
>
> >>    i = queryStringSb.indexOf("_escaped_fragment_");
> >>    if (i != -1) {
> >>      StringBuilder tmpSb = new
> >> StringBuilder(queryStringSb.substring(0, i));
> >>      tmpSb.append("#!");
> >>      tmpSb.append(URLDecoder.decode(queryStringSb.substring(i + 19,
> >> queryStringSb.length()), "UTF-8"));
> >>      queryStringSb = tmpSb;
> >>    }
> >>    if (queryStringSb.indexOf("#!") != 0) {
> >>      queryStringSb.insert(0, '?');
> >>    }
> >>    queryString = queryStringSb.toString();
>
> >>    return queryString;
> >>  }
>
> >>  private FilterConfig filterConfig = null;
>
> >>  /**
> >>   * Destroys the filter configuration
> >>   */
> >>  public void destroy() {
> >>    this.filterConfig = null;
> >>  }
>
> >>  /**
> >>   * Filters all requests and invokes headless browser if necessary
> >>   */
> >>  public void doFilter(ServletRequest request, ServletResponse
> >> response,
> >>      FilterChain chain) throws IOException {
> >>          System.out.println("crawl");
> >>    if (filterConfig == null) {
> >>      return;
> >>    }
> >>    System.out.println("crawl");
> >>    HttpServletRequest req = (HttpServletRequest) request;
> >>    HttpServletResponse res = (HttpServletResponse) response;
> >>    String queryString = req.getQueryString();
> >>    System.out.println("query:"+queryString);
> >>    System.out.println("param:"+req.getParameterMap().toString());
> >>    System.out.println("req:"+req);
> >>    if ((queryString != null) &&
> >> (queryString.contains("_escaped_fragment_"))) {
> >>        System.out.println("in!!");
> >>      StringBuilder pageNameSb = new StringBuilder("http://");
> >>      pageNameSb.append(req.getServerName());
> >>      if (req.getServerPort() != 0) {
> >>        pageNameSb.append(":");
> >>        pageNameSb.append(req.getServerPort());
> >>      }
> >>      pageNameSb.append(req.getRequestURI());
> >>      queryString = rewriteQueryString(queryString);
> >>      pageNameSb.append(queryString);
>
> >>      final WebClient webClient = new
> >> WebClient(BrowserVersion.FIREFOX_3);
> >>      webClient.setJavaScriptEnabled(true);
> >>      String pageName = pageNameSb.toString();
> >>      HtmlPage page = webClient.getPage(pageName);
> >>      webClient.waitForBackgroundJavaScriptStartingBefore(2000);
>
> >>      res.setContentType("text/html;charset=UTF-8");
> >>      PrintWriter out = res.getWriter();
> >>      out.println("<hr>");
> >>      out.println("<center><h3>You are viewing a non-interactive page
> >> that is intended for the crawler.  You probably want to see this page:
> >> <a href=\""
> >>          + pageName + "\">" + pageName + "</a></h3></center>");
> >>      out.println("<hr>");
>
> >>      out.println(page.asXml());
> >>      webClient.closeAllWindows();
> >>      out.close();
>
> >>    } else {
> >>      try {
> >>        chain.doFilter(request, response);
> >>      } catch (ServletException e) {
> >>        e.printStackTrace();
> >>      }
> >>    }
> >>  }
>
> >>  /**
> >>   * Initializes the filter configuration
> >>   */
> >>  public void init(FilterConfig filterConfig) {
> >>    this.filterConfig = filterConfig;
> >>  }
>
> >> }
>
> >> web-xml:
>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> >>              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
> >>        version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
>
> >>        <filter>
> >>                <filter-name>CrawlServlet</filter-name>
> >>                <filter-class>crawltest.server.CrawlServlet</filter-class>
> >>        </filter>
>
> >>        <filter-mapping>
> >>                <filter-name>CrawlServlet</filter-name>
> >>                <url-pattern>/*</url-pattern>
> >>        </filter-mapping>
>
> >>        <!-- Servlets -->
>
> >>        <!-- Default page to serve -->
> >>        <welcome-file-list>
> >>                <welcome-file>CrawlTest.html</welcome-file>
> >>        </welcome-file-list>
>
> >> </web-app>
>
> >> --
> >> 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+unsubscribe@googlegroups.com.
> >> For more options, visit this group athttp://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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: How to get text from textarea as html

TextArea.getText() gives you exactly the text with all white spaces and line breaks.

Its just that you can't put that text into a HTML element, because the browser will remove every line break and also trims down the white spaces to one.

If you want to display that text, you have to use the <pre> tag or apply the CSS property "white-space:pre" to any HTML element that should contain the text from the textarea.

Example:

  @Override
  public void onModuleLoad() {
    final Label label = new Label();
    final Label preLabel = new Label();
    preLabel.getElement().getStyle().setProperty("whiteSpace", "pre");
    final PreElement pre = Document.get().createPreElement();
    final TextArea textarea = new TextArea();
    textarea.setSize("300px", "200px");
    Button button = new Button("Read text");
    button.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(final ClickEvent event) {
        String text = textarea.getText();
        System.out.println(text);
        label.setText(text);
        preLabel.setText(text);
        pre.setInnerText(text);
      }
    });
    RootPanel.get().add(textarea);
    RootPanel.get().add(button);
    RootPanel.get().add(new Label("------ LABEL -------"));
    RootPanel.get().add(label);
    RootPanel.get().add(new Label("------ PRE ELEMENT -------"));
    RootPanel.get().getElement().appendChild(pre);
    RootPanel.get().add(new Label("------ LABEL (with CSS white-space:pre applied) -------"));
    RootPanel.get().add(preLabel);
  }

--
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/-/2-yl_Q62bewJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: How to get text from textarea as html

I have a ui:binder,

there i use <g:Textarea ui:field ="ta"/>

Now, when i do - ta.getText() -> returns all textarea data without spaces and line breaks.

If i do - ta.getElement().getinnerHTML() -> returns blank. No data at all.

Thanks
Deepak


On Fri, Mar 30, 2012 at 9:55 PM, Joseph Lust <lifeoflust@gmail.com> wrote:
Deepak,

Is there a reason you're not using a TextAreaElement? That has the getInnerHTML() method that will return the raw values from the TextArea.

Sincerely,
Joseph

--
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/-/8w0_YcK8_JQJ.

To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Deepak Singh

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: 2.4 RPC failure


One of the users actually figured it out
(at least one variation) --
this is crowd sourced software development.

As I wrote them, the ServiceDefTarget classes force
the service entry point to be the domain name
including "www".

So if a user went to a webpage in our domain, but
without the "www", then the various browsers would
interpret the webpage as being in a different domain
from the call to the server -- therefore
a violation of SOP.

--
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/-/w_aKtPjcKLAJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

RequestFactory change/update polling

Hello,

My UI on the client needs to stay in sync with the data on the server.  I am using request factory for all of this, and it's working great.  Currently, I have a timer that fires a request to the server every X seconds to get the most recent stuff.  From what I understand of requestfactory, even though my service is providing the whole object, the requestfactory magic only sends a select number of the fields over the wire.  When the client sees a change (via a new version, and thus an EntityProxyChange event) I can call "find" on that entity (using the 'with()') to get the whole structure and update my UI.

This all works great, but now I'm thinking about how to improve efficiency on the server.  My data is rather large, and spread out over several tables.  Each time my server gets a request via that timer on the client, the server code fetches all the data and builds up the entire object structure.  Then, RF Servlet discards most of that and only puts a few fields (mainly the id and version) in the response. Is there a way I can just provide the ID and Version to the RF Servlet response?  That way I can save some computation on the server by only grabbing that from the DB, rather than the whole structure.  Then, when RF deems that there actually was a change (by comparing versions), the "find" method will be used to grab everything.

I hope my question makes sense, I'm pretty new to the RequestFactory paradigm.  It's entirely possible that I'm failing to understand something basic.

Thanks!
--Rob

--
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/-/bJ9bxavR_kIJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Re: ajax-crawling approach to make gwt app crawlable works on default gwt example, but not on my app

Also, from http://support.google.com/webmasters/bin/answer.py?hl=en&answer=174993,
towards the bottom of the page:
...
I'm using HtmlUnit as the headless browser, and it doesn't work. Why not?
If "doesn't work" means that HtmlUnit does not return the snapshot you
were expecting to see, it's very likely that the culprit is that you
didn't give it enough time to execute the JavaScript and/or XHR
requests. To fix this, try any or all of the following:
- Use NicelyResynchronizingAjaxController. This will cause HtmlUnit
to wait for any outstanding XHR calls.
- Bump up the wait time for waitForBackgroundJavaScript and/or
waitForBackgroundJavaScriptStartingBefore.


On Fri, Mar 30, 2012 at 12:37 PM, Ovidiu Mihaescu <gandacu@gmail.com> wrote:
> Does your existing app's URLs conform to the spec at
> https://developers.google.com/webmasters/ajax-crawling/docs/specification
> ? More specifically, do all your history tokens start with an
> exclamation mark?
>
> On Fri, Mar 30, 2012 at 9:31 AM, erebrus <erebrus@gmail.com> wrote:
>> Hi all,
>> I was reading https://developers.google.com/webmasters/ajax-crawling/
>> on how to make ajax apps (consequently gwt apps) crawlable.
>> I took the code from google (summarized in point 3 of "How to create
>> an HTML snapshot?" to create a filter (that returns html from ajax
>> using HtmlUnit) and changed the web.xml accordingly. I created a new
>> GWT project with example code and applied the filter and the web.xml
>> there. It worked directly.
>> However, I did exactly the same on the gwt app I want to make
>> searchable and it doesn't work. For some reason, the only requests the
>> filter gets are the ones to the ones for the rpc.
>> I think I must be missing a terribly simple detail, but I'm a bit lost
>> on where to go from here.
>>
>>
>> Following you can see the code for the filter (CrawlServlet) and the
>> web.xml
>>
>> package crawltest.server;
>>
>> import com.gargoylesoftware.htmlunit.BrowserVersion;
>> import com.gargoylesoftware.htmlunit.WebClient;
>> import com.gargoylesoftware.htmlunit.html.HtmlPage;
>>
>> import java.io.IOException;
>> import java.io.PrintWriter;
>> import java.io.UnsupportedEncodingException;
>> import java.net.URLDecoder;
>> import java.util.logging.Logger;
>>
>> import javax.servlet.Filter;
>> import javax.servlet.FilterChain;
>> import javax.servlet.FilterConfig;
>> import javax.servlet.ServletException;
>> import javax.servlet.ServletRequest;
>> import javax.servlet.ServletResponse;
>> import javax.servlet.http.HttpServletRequest;
>> import javax.servlet.http.HttpServletResponse;
>>
>> /**
>>  * Servlet that makes this application crawlable
>>  */
>> public final class CrawlServlet implements Filter {
>>
>>        private static final Logger logger =
>> Logger.getLogger(CrawlServlet.class
>>                        .getName());
>>  private static String rewriteQueryString(String queryString) throws
>> UnsupportedEncodingException {
>>    StringBuilder queryStringSb = new StringBuilder(queryString);
>>    int i = queryStringSb.indexOf("&_escaped_fragment_");
>>    if (i != -1) {
>>      StringBuilder tmpSb = new
>> StringBuilder(queryStringSb.substring(0, i));
>>      tmpSb.append("#!");
>>      tmpSb.append(URLDecoder.decode(queryStringSb.substring(i + 20,
>> queryStringSb.length()),"UTF-8"));
>>      queryStringSb = tmpSb;
>>    }
>>
>>    i = queryStringSb.indexOf("_escaped_fragment_");
>>    if (i != -1) {
>>      StringBuilder tmpSb = new
>> StringBuilder(queryStringSb.substring(0, i));
>>      tmpSb.append("#!");
>>      tmpSb.append(URLDecoder.decode(queryStringSb.substring(i + 19,
>> queryStringSb.length()), "UTF-8"));
>>      queryStringSb = tmpSb;
>>    }
>>    if (queryStringSb.indexOf("#!") != 0) {
>>      queryStringSb.insert(0, '?');
>>    }
>>    queryString = queryStringSb.toString();
>>
>>
>>
>>    return queryString;
>>  }
>>
>>  private FilterConfig filterConfig = null;
>>
>>  /**
>>   * Destroys the filter configuration
>>   */
>>  public void destroy() {
>>    this.filterConfig = null;
>>  }
>>
>>  /**
>>   * Filters all requests and invokes headless browser if necessary
>>   */
>>  public void doFilter(ServletRequest request, ServletResponse
>> response,
>>      FilterChain chain) throws IOException {
>>          System.out.println("crawl");
>>    if (filterConfig == null) {
>>      return;
>>    }
>>    System.out.println("crawl");
>>    HttpServletRequest req = (HttpServletRequest) request;
>>    HttpServletResponse res = (HttpServletResponse) response;
>>    String queryString = req.getQueryString();
>>    System.out.println("query:"+queryString);
>>    System.out.println("param:"+req.getParameterMap().toString());
>>    System.out.println("req:"+req);
>>    if ((queryString != null) &&
>> (queryString.contains("_escaped_fragment_"))) {
>>        System.out.println("in!!");
>>      StringBuilder pageNameSb = new StringBuilder("http://");
>>      pageNameSb.append(req.getServerName());
>>      if (req.getServerPort() != 0) {
>>        pageNameSb.append(":");
>>        pageNameSb.append(req.getServerPort());
>>      }
>>      pageNameSb.append(req.getRequestURI());
>>      queryString = rewriteQueryString(queryString);
>>      pageNameSb.append(queryString);
>>
>>      final WebClient webClient = new
>> WebClient(BrowserVersion.FIREFOX_3);
>>      webClient.setJavaScriptEnabled(true);
>>      String pageName = pageNameSb.toString();
>>      HtmlPage page = webClient.getPage(pageName);
>>      webClient.waitForBackgroundJavaScriptStartingBefore(2000);
>>
>>      res.setContentType("text/html;charset=UTF-8");
>>      PrintWriter out = res.getWriter();
>>      out.println("<hr>");
>>      out.println("<center><h3>You are viewing a non-interactive page
>> that is intended for the crawler.  You probably want to see this page:
>> <a href=\""
>>          + pageName + "\">" + pageName + "</a></h3></center>");
>>      out.println("<hr>");
>>
>>      out.println(page.asXml());
>>      webClient.closeAllWindows();
>>      out.close();
>>
>>    } else {
>>      try {
>>        chain.doFilter(request, response);
>>      } catch (ServletException e) {
>>        e.printStackTrace();
>>      }
>>    }
>>  }
>>
>>  /**
>>   * Initializes the filter configuration
>>   */
>>  public void init(FilterConfig filterConfig) {
>>    this.filterConfig = filterConfig;
>>  }
>>
>> }
>>
>>
>> web-xml:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>>              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>>        version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
>>
>>        <filter>
>>                <filter-name>CrawlServlet</filter-name>
>>                <filter-class>crawltest.server.CrawlServlet</filter-class>
>>        </filter>
>>
>>        <filter-mapping>
>>                <filter-name>CrawlServlet</filter-name>
>>                <url-pattern>/*</url-pattern>
>>        </filter-mapping>
>>
>>        <!-- Servlets -->
>>
>>        <!-- Default page to serve -->
>>        <welcome-file-list>
>>                <welcome-file>CrawlTest.html</welcome-file>
>>        </welcome-file-list>
>>
>> </web-app>
>>
>>
>>
>> --
>> 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+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.