Best way for launching html/jsp to communicate with GWT module
        Posted  
        
            by h2g2java
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by h2g2java
        
        
        
        Published on 2010-04-21T07:28:49Z
        Indexed on 
            2010/04/21
            7:33 UTC
        
        
        Read the original article
        Hit count: 409
        
gwt
|JavaScript
I asked this at the GWT forum but I'm impatient for the answer and I seem to get rather good responses here.
A html or jsp file is used to launch the xxx.nocache.js, which then decides which browser "permutation" to use.
<head>
 <meta http-equiv="content-type" content="text/html;charset=UTF-8">
 <title>xxx</title>
 <script type="text/javascript" language="javascript" src="xxx.nocache.js"></script>
</head>
In my case, I am using a jsp. When the JSP is executed, it discovers some conditions. I wish to pass these conditions as values to the GWT module being launched. The "elegant" GWT way to pass these values would be to persist them as request/memcache attributes and then have the GWT module perform RPC to retrieve those values.
For example, the JSP discovers that the current user is Whoopy. Shouldn't I simply have the JSP generate javascript to store
user = "Whoopy"
as a top or namedframe level javascript variable and use JSNI within the module to retrieve the value for user?
I have not tried it yet, but I would like to know how anyone might have done it without having to use RPC.
© Stack Overflow or respective owner