Archive for January 2007

GWT – 1 : Re Entry into GWT

I got into GWT (Google Web ToolKit), and I found it is very useful to make future rich web applications. then somehow I cudnt continue it and left as such. Since I had very less time to roll in the web changes, I dint give much importance to gwt in our product. somewhat, I got good mood today, oops, at mid night… truely saying, I got some time, while downloading a divx :)

yes, here is the thing.
They offer a zip for windows (probably a tar for linux) which contains the SDK and some sample applications.

Actuallly why you need GWT?
no need for this question. but to complete this post, I need to tell this, right! Actually for those who cudnt write javascripts without bugs and for those who need better stable layout, google offers this pack. hey friends, you dont need to write js or html. just write equivalent java code, he will compile and give you the relavent html/css/js for you. :) cool, isnt it!

I just extracted to one of the folders D:\projects\gwt\gwt-windows-1.0.21
See the following the content

D:\projects\gwt\gwt-windows-1.0.21>dir/w Volume in drive D is PERSONAL Volume Serial Number is BCE3-A541 Directory of D:\projects\gwt\gwt-windows-1.0.21 [.] [..] [samples] applicationCreator.cmd gwt-dev-windows.jar gwt-ll.dll gwt-user.jar junitCreator.cmd projectCreator.cmd swt-win32-3139.dll about.html about.txt index.html [doc]

See there is a applicationCreator.cmd . lets talk about this later. before that lets enter into the samples directory.

GWT had given five useful sample applications.
[DynaTable]
[Hello]
[JSON]
[KitchenSink]
[Mail]

let’s take one simple application now. ‘Hello’

As google says, there are two ways to run this application.

HOSTED MODE:
We will run _shell script here. it will just open the google browser and run your application.

WEBMODE:
Here we will run _compile script. it will compile your java file and create corresponding css, html, js files. you can view the html files later with your favorite browser. you have the java file. you can make some minor changes and see, how do you get the output!

see,
D:\projects\gwt\gwt-windows-1.0.21\samples\Hello>Hello-compile.cmd
Output will be written into D:\projects\gwt\gwt-windows-1.0.21\samples\Hello\www
\com.google.gwt.sample.hello.Hello
Compilation succeeded

html files are written into D:\projects\gwt\gwt-windows-1.0.21\samples\Hello\www now

so, we came to an idea how it runs.

coming back to applicationCreator….
this will create a new project for you with necessary files.

D:\projects\gwt\gwt-windows-1.0.21\samples\Hello>applicationCreator.cmd net.vaigai.client.MyApp

package client is a must!

will get back to you with updates slightly later!

:)

HAPPY PONGAL





I am going on two days leave to celebrate our farmer’s festival, PONGAL 2007

Pongal, sankaranti wishes for you all!

https – Servlet – Attachment – IE not working

Hi, I have a servlet which will send me PDF stream. It is working good in IE and Firefox. When operating in secured mode (https), IE couldnt download the attachment. it stops in halfway. There were no exceptions thrown at the servlet end. Atlast, we found the line

response.setHeader(“Pragma”, “no-cache”);

is the culprit. when we dint set this header param when operating in secured mode,
it is working fine. :)

Microsoft site says “This behavior occurs when the Content Expiration option in the
Hypertext Transfer Protocol (HTTP) Headers, within IIS, is set to
Expire Immediately. Internet Explorer must save any Microsoft Office
file to the local cache directory, and then use the associated
application to open the file. If you set Content Expiration to Expire
Immediately, the Office documents are not cached locally and the
operation fails.”

mm. anyway, it dint take much time. we cud guess this from another servlet we have :)