Hi,
GWT lives in client space so :

* Simple way:

In your jsp:
<script>
var myVar = "<%= (String)session.getAttribute("myVar") %>";
</script>

And in your module :

JNSI.getString("myVar", "defaultValue");

with the JNSI class:

public class JNSI {
 public static native String getString(String jsVar, String
defaultValue)/*-{
      var value = eval('$wnd.'+jsVar);
      if(value){
        return value;
      }
      return defaultValue;
    }-*/;
}

*  more complex  :

Define some API in your GWT module by hand or with something like GWT
Exporter (
http://timepedia.blogspot.com/2008/06/preliminary-gwt-export-20-release.html
):

ie: module provides setMyVar(String method)

call your api from JSP page **after the module sas started**

<script>
function gwt_callback_called_by_gwt_module_onLoad(){
  setMyVar("<%= (String)session.getAttribute("myVar") %>");
}

HTH

On Fri, Oct 24, 2008 at 4:47 AM, Sumved <[EMAIL PROTECTED]> wrote:

>
> Hi All,
>
> I am wondering whether we can pass parameter from JSP to GWT Entry
> point.
> I hope it is there because in real scenario probably no-body will use
> only GWT.
>
> Like, I have integrated Struts with GWT.
>
> Now, My question is, Can we pass a value from JSP to GWT Entry point?
>
> Thanks in advance.
>
> Regards,
> Sumved Shami
>
> >
>


-- 
Si l'ignorance peut servir de consolation, elle n'en est pas moins
illusoire.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to