Why Asynchronous?

2010-05-18 Thread Emeric Heneffe
Hi!

I need to know the exact reason why classes that's gonna be transfered
from server side to client side must implements Serializable? It's
written everywhere
that they had to implement Serializable but never explain why???

Thank you..

-- 
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: Why Asynchronous?

2010-05-18 Thread Emeric Heneffe
Thank you for answers.. everything is ok now...

Regards

On 18 mai, 22:43, Blessed Geek blessedg...@gmail.com wrote:
 Why asynchronous?

 This is a classic examination question in data communications.

 Why serializable? - another classic examination question.

 Classic - meaning that the professors in data communication would want
 to ensure you understand them before they would like you to be given a
 piece of paper to pass through the pearly gates of their academic
 institutions to make your contributions to the data engineering world.

 Asynchronous
 ==
 Remember the days of pure JSP and HTML pages and absence of AJAX? You
 would have a page with multiple cells. Your user would need to fill up
 the page cells, click on submit. Then the page blanks off for a while.
 Sometimes it is longer than a while. Sometimes, you need to send an
 intervening page to say, server still processing, please be patient.

 We used to ask, why couldn't we just send the request out without
 refreshing the page. Why can't the web page be allowed to continue to
 function while waiting for the response? For example, for a page
 displaying the price trend of a stock, when a request is sent to the
 server to refresh the stock price, I would like to continue being able
 to zoom in and out of the chart of its historical prices. In the old
 days, we would click on a submit button, the screen blanks off and we
 go get a cup of coffee and then the browser relents to display the
 page when the server finally sends its response.

 So asynchrony is a desirable condition, not a disadvantage. You may
 ask, why can't the browser display the response as soon as possible
 rather than wait asynchronously. The browser not displaying as soon as
 possible is not the fault of asynchrony. It is the fault of slow
 servers and faulty data cables - that we use asynchrony as a
 compensatory measure. If you don't like asynchrony, you could revert
 back to the old days of a blanked screen waiting for the server to
 respond. Or spend a lot of money upgrading your servers and data
 cabling.

 Serializable
 
 Imagine Moses and the Red sea. Let us say that the angel opened up the
 a passage in the Red sea to allow only a single file of people to pass
 through. The Pharaoh's army is behind pursuing the Israelites and
 Moses has to make sure his people get across to the other side of the
 sea as quickly as possible.

 So the Israelites are now assembled according to tribe, and then by
 clan, and then by family. They stick together in that hierarchy. But
 the passage across the sea allows only one person row of people. So
 Moses has to break the tribes, clans and families up and marshal them
 into a single row of people. And then on the other side, he has to
 ensure they are able to reassemble them back into their tribe, clan
 and family hierarchy. You wouldn't want Moses faced with the situation
 of a child, on reaching the other side, crying where is my mummy and
 daddy?, would you?

 There is a data communication channel between your browser (where you
 might be sitting in a cafe in Ougadougou) and the server (sitting
 somewhere in Mumbai). You might not be aware of that if you are on
 development mode where your browser, server and Eclipse sits on the
 same machine, wondering why can't they just pass objects to each other
 by sharing the computer's memory. But you are developing for a remote-
 to-remote situation where the data lines, in theory, require you to
 send your objects in a serial manner.

 By implementing Serializable, you are telling the data communication
 channel where to find the disassembling/serializing routines and then
 where to find the reassembly/deserializing routines for your
 object.Most classes already come with serializing/deserializing
 routines so you only need to implement Serializable, otherwise you
 would need to write the serializer/deserializer.

 If you are developing using the Google Plugin for Eclipse, you need to
 turn the GAE option off if you are not developing for GAE. When you
 develop for GAE, or any cloudified environment, your application needs
 its sessions to be allowed to shift from server to server across the
 world. That is how the cloud owner would like to optimise their
 resources and the response of your application. In order to facilitate
 that kind of shift, your objects need to be serializable.

 --
 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 
 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-tool...@googlegroups.com.
To unsubscribe from this group, send email 

Re: Transfer problem from clien side to server side

2010-05-11 Thread Emeric Heneffe
Hello,
The fact is that normally I had to use gilead to save pojos in a db.
But, before using this, I had to transfer
these pojo to server side. To do this, I use a simple rpc request with
my classes that extend Serializable (and not
IsSerializable because I don't want that my core package has
dependencies with gwt)... But when I transfer some pojo
coming from my core package, there is a problem and I can't transfer
it, no exception but at server side, all reference
of the transfered object are null.. However, if I want to transfer a
class that is present in client package (see my organization
in first post), there is no problem...

On 10 mai, 20:32, Sorinel C scristescu...@hotmail.com wrote:
 Why not using the simple GWT RPC to send objects from the server to
 client?

 You have just to extend the IsSerializable interface and that's your
 kind of  POJO :-)

 [code]
 public class MyObject extends IsSerializable {

    /* mandatory constructor to be serializable */
    public MyObject () {
    }

 }

 [/code]

 See more hints about GWT and more here:http://ui-programming.blogspot.com/

 Cheers!

 --
 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 
 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-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: Transfer problem from clien side to server side

2010-05-09 Thread Emeric Heneffe
Still no ideas?

On 5 mai, 10:42, Emeric Heneffe emeric.hene...@gmail.com wrote:
 Hello,
 I'm using a gwt application and I have a problem when I send pojo from
 core module (not client package) to server side. Indeed, when I send
 any pojo with properties, in server side, all properties become
 null... Here is the configuration and the package I use :

 core.lib - librairies
 core.src.java.core.datamodel - all Pojos
 core.src.java.core.dao - all dao

 web.lib - librairies used for gxt, gilead...
 web.src.java.web.client - some classes of gxt
 web.src.java.web.server - server classes
 web.src.resources.web - gwt.xml file :

 Here is the gwt.xml file
 [code]
 !DOCTYPE module PUBLIC -//Google Inc.//DTD Google Web Toolkit 2.0//
 EN http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-
 source/core/src/gwt-module.dtd module rename-to=argf !--
 Inherit the core Web Toolkit stuff. -- inherits name[code]
 !DOCTYPE module PUBLIC -//Google Inc.//DTD Google Web Toolkit 2.0//
 EN
 http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-
 source/core/src/gwt-module.dtd
 module rename-to=argf
 !-- Inherit the core Web Toolkit stuff. --
 inherits name='com.google.gwt.user.User'/
 inherits name=com.google.gwt.i18n.I18N/
 inherits name=com.google.gwt.http.HTTP/
 inherits name=core/ !-- Definition following --
 !-- Inherit GXT --
 inherits name='com.extjs.gxt.ui.GXT'/

 !-- Specify the app entry point class. --
 entry-point class='web.client.ARGF'/

 !-- packages to convert into JavaScript --
 source path='client'/

 !-- specify user-agent --
 set-property name=user.agent value=gecko1_8/

 /module
 [/code]

 In web.src.resources, we can find core.gwt.xml, defining bind with
 pojo :

 [code]
 !DOCTYPE module PUBLIC -//Google Inc.//DTD Google Web Toolkit 2.0//
 EN
 http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-
 source/core/src/gwt-module.dtd
 module
 -source path='core/datamodel'/
 set-property name=user.agent value=gecko1_8/
 /module
 [/code]

 web.web.WEB-INF - web.xml, applicationContext.xml, handler-
 servlet.xml

 Here is my web.xml

 [code]
 ?xml version=1.0 encoding=UTF-8? web-app xmlns=http://
 java.sun.com/xml/ns/javaee xmlns:xsi=http://www.w3.org/2001/
 XMLSchema-instance xsi:schemaLocation=ht[code]
 ?xml version=1.0 encoding=UTF-8?
 web-app xmlns=http://java.sun.com/xml/ns/javaee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
 version=2.5

 !-- Spring context --
 context-param
 param-namecontextConfigLocation/param-name
 param-value
 classpath:/spring-config-web.xml
 classpath:dao-config-test.xml
 /WEB-INF/handler-servlet.xml
 /WEB-INF/applicationContext.xml
 /param-value
 /context-param
 listener
 listener-classorg.springframework.web.context.ContextLoaderListener/
 listener-class
 /listener

 listener
 listener-classorg.springframework.web.util.Log4jConfigListener/
 listener-class
 /listener

 servlet
 servlet-namehandler/servlet-name
 servlet-classorg.springframework.web.servlet.DispatcherServlet/
 servlet-class
 load-on-startup1/load-on-startup
 /servlet
 servlet-mapping
 servlet-namehandler/servlet-name
 url-pattern/argf/service/*/url-pattern
 /servlet-mapping
 /web-app
 [/code]

 And here is my handler-servlet

 [code]
 ?xml version=1.0 encoding=UTF-8? beans 
 xmlns=http://www.springframework.org/schema/beans; 
 xmlns:xsi=http://www.w3.org/
 2001/XMLSchema-instance xmlns:p=http://www.springframework.org/
 schema/p xmlns:context=http://www.springframework.org/schema/
 context xmlns:tx=http://www.springframework.org/schema/tx;
 xmlns:aop=http://www.springframework.org/schema/aop;
 xsi:schemaLocation=http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-2.5.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-2.5.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-2.0.xsd;
  bean
 id=urlMapping[code]
 ?xml version=1.0 encoding=UTF-8?
 beans xmlns=http://www.springframework.org/schema/beans;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:p=http://www.springframework.org/schema/p;
 xmlns:context=http://www.springframework.org/schema/context;
 xmlns:tx=http://www.springframework.org/schema/tx;
 xmlns:aop=http://www.springframework.org/schema/aop;
 xsi:schemaLocation=http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-2.5.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-2.5.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-2.0.xsd;

     bean id=urlMapping

Transfer problem from clien side to server side

2010-05-06 Thread Emeric Heneffe
Hello,
I'm using a gwt application and I have a problem when I send pojo from
core module (not client package) to server side. Indeed, when I send
any pojo with properties, in server side, all properties become
null... Here is the configuration and the package I use :

core.lib - librairies
core.src.java.core.datamodel - all Pojos
core.src.java.core.dao - all dao

web.lib - librairies used for gxt, gilead...
web.src.java.web.client - some classes of gxt
web.src.java.web.server - server classes
web.src.resources.web - gwt.xml file :

Here is the gwt.xml file
[code]
!DOCTYPE module PUBLIC -//Google Inc.//DTD Google Web Toolkit 2.0//
EN http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-
source/core/src/gwt-module.dtd module rename-to=argf !--
Inherit the core Web Toolkit stuff. -- inherits name[code]
!DOCTYPE module PUBLIC -//Google Inc.//DTD Google Web Toolkit 2.0//
EN
http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-
source/core/src/gwt-module.dtd
module rename-to=argf
!-- Inherit the core Web Toolkit stuff. --
inherits name='com.google.gwt.user.User'/
inherits name=com.google.gwt.i18n.I18N/
inherits name=com.google.gwt.http.HTTP/
inherits name=core/ !-- Definition following --
!-- Inherit GXT --
inherits name='com.extjs.gxt.ui.GXT'/

!-- Specify the app entry point class. --
entry-point class='web.client.ARGF'/

!-- packages to convert into JavaScript --
source path='client'/

!-- specify user-agent --
set-property name=user.agent value=gecko1_8/

/module
[/code]

In web.src.resources, we can find core.gwt.xml, defining bind with
pojo :

[code]
!DOCTYPE module PUBLIC -//Google Inc.//DTD Google Web Toolkit 2.0//
EN
http://google-web-toolkit.googlecode.com/svn/releases/2.0/distro-
source/core/src/gwt-module.dtd
module
-source path='core/datamodel'/
set-property name=user.agent value=gecko1_8/
/module
[/code]


web.web.WEB-INF - web.xml, applicationContext.xml, handler-
servlet.xml

Here is my web.xml

[code]
?xml version=1.0 encoding=UTF-8? web-app xmlns=http://
java.sun.com/xml/ns/javaee xmlns:xsi=http://www.w3.org/2001/
XMLSchema-instance xsi:schemaLocation=ht[code]
?xml version=1.0 encoding=UTF-8?
web-app xmlns=http://java.sun.com/xml/ns/javaee;
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

!-- Spring context --
context-param
param-namecontextConfigLocation/param-name
param-value
classpath:/spring-config-web.xml
classpath:dao-config-test.xml
/WEB-INF/handler-servlet.xml
/WEB-INF/applicationContext.xml
/param-value
/context-param
listener
listener-classorg.springframework.web.context.ContextLoaderListener/
listener-class
/listener

listener
listener-classorg.springframework.web.util.Log4jConfigListener/
listener-class
/listener

servlet
servlet-namehandler/servlet-name
servlet-classorg.springframework.web.servlet.DispatcherServlet/
servlet-class
load-on-startup1/load-on-startup
/servlet
servlet-mapping
servlet-namehandler/servlet-name
url-pattern/argf/service/*/url-pattern
/servlet-mapping
/web-app
[/code]

And here is my handler-servlet

[code]
?xml version=1.0 encoding=UTF-8? beans xmlns=http://
www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/
2001/XMLSchema-instance xmlns:p=http://www.springframework.org/
schema/p xmlns:context=http://www.springframework.org/schema/
context xmlns:tx=http://www.springframework.org/schema/tx;
xmlns:aop=http://www.springframework.org/schema/aop;
xsi:schemaLocation=http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx 
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd; bean
id=urlMapping[code]
?xml version=1.0 encoding=UTF-8?
beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:p=http://www.springframework.org/schema/p;
xmlns:context=http://www.springframework.org/schema/context;
xmlns:tx=http://www.springframework.org/schema/tx;
xmlns:aop=http://www.springframework.org/schema/aop;
xsi:schemaLocation=http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx 
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd;

bean id=urlMapping
class=org.springframework.web.servlet.handler.SimpleUrlHandlerMapping
property name=mappings
map
entry key=/iprw value-ref=iprwServiceExporter/