Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8776895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:09:49+00:00 2026-06-13T19:09:49+00:00

I have created a GWT widget with root container ID widgetContainer and the corresponding

  • 0

I have created a GWT widget with root container ID “widgetContainer” and the corresponding compiled file is gwtwidget.nocache.js. I have created a war file of this widget and hosted in a local server localhost:8888/gwtwidget.

I created another jsp application and the index.jsp is as follow: (Integrated GWT module into JSP application)

<html>
<head>
    <script type="text/javascript" language="javascript" src="http://localhost:8888/gwtwidget/gwtwidget/gwtwidget.nocache.js?appId=461333815262909&appId=461333815262909&appId=461333815262909&appId=461333815262909"></script>
</head>
<body>
    <div id="widgetContainer"></div>
</body>
</html>

I want to retrieve the parameters which are passed through the nocache.js file from the JSP application. For this purpose, I’m using the code

public static native String getParameter( String moduleName, String parameterName ) /*-{
var search = "/" + moduleName + ".nocache.js";
var scripts = $doc.getElementsByTagName( "script" );
for( var i = 0; i < scripts.length; ++i ) {
    if( scripts[ i ].src != null && scripts[ i ].src.indexOf( search ) != -1 ) {
        var parameters = scripts[ i ].src.match(/\w+=\w+/g);
        for( var j = 0; j < parameters.length; ++j ) {
            var keyvalue = parameters[ j ].split( "=" );
            if( keyvalue.length == 2 && keyvalue[ 0 ] == parameterName ) {
                return unescape( keyvalue[ 1 ] );
            }
        }
    } 
}
return null;
}-*/;   

But unable to get the parameter values into the GWT widget. Can any one please help me in solving this problem?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:09:52+00:00Added an answer on June 13, 2026 at 7:09 pm

    If you want pass parameters using query string, it is not straight forward. There are ways to that. You can refer the following posts:

    1. Passing parameters to JavaScript files
    2. Pass vars to JavaScript via the SRC attribute

    There is another way, which I feel is simpler. You can set a cookie in your jsp file. You can read the cookie in your GWT module.

    <html>
    <head>
    <script type="text/javascript">
        document.cookie="appId=461333815262909"
    </script>
        <script type="text/javascript" language="javascript" src="http://localhost:8888/gwtwidget/gwtwidget/gwtwidget.nocache.js"></script>
    </head>
    <body>
        <div id="widgetContainer"></div>
    </body>
    </html>
    

    You can access the cookie ‘appId’ in your GWT module as:

    String param = Cookies.getCookie("appId");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created the file upload control in GWT and have one submit button
I have created a sort of CMS with GWT. This CMS has several widgets
I have created a custom widget in gwt which extends the composite.I am using
I have a custom widget ( OrderItem ) in a GWT project. This widget
I have a servlet in an GWT app thats creates a PDF file with
I have a view that I created in my GWT application and I would
I have created a class which extends com.smartgwt.client.widgets.grid.ListGridRecord and implements com.google.gwt.user.client.rpc.IsSerializable. I am returning
I have a CellTable created in GWT that allows users to update/delete records in
I'm trying to understand the RPC functionality which GWT uses, and have followed this
I have created a GWT project that has some menu items. These menu items

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.