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

  • SEARCH
  • Home
  • 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 7083051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:07:50+00:00 2026-05-28T07:07:50+00:00

I want to display a msg from server when user clicks a button on

  • 0

I want to display a msg from server when user clicks a button on client web page. Here is my code. Can someone see it. It is running but fails when I input name & press button ‘Press’.Displays msg ‘check ur inputs’

here is stack trace:

[WARN] 404 - POST /lumiproj/testService (127.0.0.1) 1406 bytes
   Request headers
      Host: 127.0.0.1:8888
      Connection: keep-alive
      User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7
      Accept: */*
      Accept-Encoding: gzip,deflate,sdch
      Accept-Language: en-US,en;q=0.8
      Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
      Referer: http://127.0.0.1:8888/LumiProj.html?gwt.codesvr=127.0.0.1:9997
      Content-Length: 159
      Origin: http://127.0.0.1:8888
      X-GWT-Module-Base: http://127.0.0.1:8888/lumiproj/
      X-GWT-Permutation: HostedMode
      Content-Type: text/x-gwt-rpc; charset=UTF-8
   Response headers
      Content-Type: text/html; charset=iso-8859-1
      Content-Length: 1406

web.xml

<?xml version="1.0" encoding="UTF-8"?>

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&#8221;
version=”2.5″
xmlns=”http://java.sun.com/xml/ns/javaee&#8221;>

LumiProjServiceImpl
com.hello.server.LumiProjServiceImpl

LumiProjServiceImpl
/lumiproj/greet

LumiProj.html

entrypoint class

package com.hello.client;

//import rpctest.client.RpctestService;
//import rpctest.client.RpctestServiceAsync;

import com.hello.shared.FieldVerifier;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class LumiProj implements EntryPoint {

    final TextBox nameText = new TextBox();
    final Label nameLabel = new Label("Enter name");
    final Button pressBtn = new Button("Press!");
    final Button exitBtn = new Button("exit");
    //final Label errorLabel = new Label();
    private VerticalPanel mainpanel = new VerticalPanel();
    private HorizontalPanel addpanel1 = new HorizontalPanel();
    private HorizontalPanel addpanel2 = new HorizontalPanel();




    private final LumiProjServiceAsync calNumbers = GWT
            .create(LumiProjService.class);

    /**
     * This is the entry point method.
     */
    public void onModuleLoad() {

        addpanel1.add(nameLabel);
        addpanel1.add(nameText);
        addpanel2.add(pressBtn);
        addpanel2.add(exitBtn);
        mainpanel.add(addpanel1);
        mainpanel.add(addpanel2);

        pressBtn.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {

            String name = nameText.getValue();  

            calNumbers.calNumbers(name,
                new AsyncCallback<String>() {
                public void onFailure(Throwable caught) {
                    // Show the RPC error message to the user
                        Window.alert("check your inputs");
                    }

                @Override
                public void onSuccess(String result) {
                // TODO Auto-generated method stub
                    Window.alert("answer="+result);
                }
            });}
        });
        // We can add style names to widgets
        //sendButton.addStyleName("sendButton");

        // Add the nameField and sendButton to the RootPanel
        // Use RootPanel.get() to get the entire body element

        /*RootPanel.get("nameFieldContainer").add(nameField);
         * 
        RootPanel.get("sendButtonContainer").add(sendButton);
        RootPanel.get("errorLabelContainer").add(errorLabel);*/
        RootPanel.get().add(mainpanel);

    }
}

service interfaces:

package com.hello.client;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("testService")
public interface LumiProjService extends RemoteService {

    String calNumbers(String name) throws IllegalArgumentException;
}

------------------
package com.hello.client;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface LumiProjServiceAsync {

    void calNumbers(String name,
            AsyncCallback<String> callback);
}

serviceIMPL

package com.hello.server;

import com.hello.client.LumiProjService;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class LumiProServiceImpl extends RemoteServiceServlet  implements LumiProjService {

    @Override
    public String calNumbers(String name) throws IllegalArgumentException {

        String h = "Hello";

        return h+" "+name;
    }
}
  • 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-05-28T07:07:51+00:00Added an answer on May 28, 2026 at 7:07 am

    Can you post gwt error stack trace(if exists) or text of Throwable in

        public void onFailure(Throwable caught) 
    

    ?

    Also, post please your web.xml file, may be there is error in servlet path mapping

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to display a msg to the user (msg box or Toast) when
I want to display a success msg after finishing an Ajax call. I tried
I want to display the TIME field from my mysql table on my website,
I want to display tabular type data, but it will not be coming from
I'm trying to type-check the commands I want to send to a server from
I want to update/edit a devise user from my own form in my project,
I have a search results page and I want to display it in tables.
Below I have a jquery code which includes a textbox where the user can
I have a simple quiz application and I want display a nice timer /
I want to display dates in the format: short day of week, short month,

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.