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 7966949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:34:08+00:00 2026-06-04T06:34:08+00:00

I’m making RPC in my GWT project and it’s running but the data I

  • 0

I’m making RPC in my GWT project and it’s running but the data I wanna work with disapper somehow. I am using the localhost as server. I have two classes in the server package:
Defences:

 package org.elsys.salvation.server;


import org.elsys.salvation.client.Defence;
import org.elsys.salvation.client.FunctionalityManager;

public class Defences {

    private ArrayList<Defence> netDefences;
    private ArrayList<Defence> hardDefences;
    private ArrayList<Defence> softDefences;

    public Defences(FunctionalityManager fm){
        netDefences = fm.getNetDefences();
        hardDefences = fm.getHardDefences();
        softDefences = fm.getSoftDefences();
    }

    public ArrayList<Defence> getNetDefences() {
        return netDefences;
    }

    public ArrayList<Defence> getHardDefences() {
        return hardDefences;
    }

    public ArrayList<Defence> getSoftDefences() {
        return softDefences;
    }
}

and DefenceServiceImpl.java :

package org.elsys.salvation.server;

import java.util.ArrayList;

import org.elsys.salvation.client.DefenceService;
import org.elsys.salvation.client.FunctionalityManager;

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

public class DefenceServiceImpl extends RemoteServiceServlet implements DefenceService {

    private Defences defences;

    @Override
    public void saveDefences(FunctionalityManager fm) {
        defences = new Defences(fm);
    }

    @Override
    public void getHardDefences(FunctionalityManager fm) {
        fm.setHardDefences(defences.getHardDefences());
    }

    @Override
    public void getNetDefences(FunctionalityManager fm) {
        fm.setNetDefences(defences.getNetDefences());
    }

    @Override
    public void getSoftDefences(FunctionalityManager fm) {
        fm.setSoftDefences(defences.getSoftDefences());
    }

}

Here are the DefenceService interface:

package org.elsys.salvation.client;

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

@RemoteServiceRelativePath("defences")
public interface DefenceService extends RemoteService {

    void saveDefences(FunctionalityManager fm);
    void getHardDefences(FunctionalityManager fm);
    void getNetDefences(FunctionalityManager fm);
    void getSoftDefences(FunctionalityManager fm);
}

and DefenceServiceAsync:

package org.elsys.salvation.client;

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

public interface DefenceServiceAsync {

    void saveDefences(FunctionalityManager fm, AsyncCallback<Void> callback);

    void getHardDefences(FunctionalityManager fm, AsyncCallback<Void> callback);

    void getNetDefences(FunctionalityManager fm, AsyncCallback<Void> callback);

    void getSoftDefences(FunctionalityManager fm, AsyncCallback<Void> callback);

}

Here is the code where I am calling the saveDefences method:

private void addDiploma() {

        final AsyncCallback<Void> callback = new AsyncCallback<Void>() {
            public void onFailure(Throwable caught) {

            }

            @Override
            public void onSuccess(Void result) {
                SC.say("Submited");
            }
        };

        some code...

        Button submitButton = new Button("Submit");
        submitButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                FM.getDiploma(projectNameTextBox, diplomantsNameTextBox,
                        diplomaLeadersListBox, reviewersListBox,
                        specialtiesComboBox, typeComboBox);
                FM.generateDefences();
                defenceSvc.saveDefences(FM,callback);
                RootPanel.get("mainDiv").clear();
                showDefences();
            }
        });

        some more code...
    }

Here is the defenition of FM and defenceSvc:

public FunctionalityManager FM = new FunctionalityManager();
private DefenceServiceAsync defenceSvc = GWT.create(DefenceService.class);

here is where I want to get saved data back to the client side:

protected void showDefence() {  
        FunctionalityManager funcM = new FunctionalityManager();
        final AsyncCallback<Void> callback = new AsyncCallback<Void>() {
            public void onFailure(Throwable caught) {

            }

            @Override
            public void onSuccess(Void result) {
                // TODO Auto-generated method stub  
            }
        };
        defenceSvc.getHardDefences(funcM, callback);  
        defenceSvc.getNetDefences(funcM, callback);  
        defenceSvc.getSoftDefences(funcM, callback);  
        final ListGrid DiplomaGrid = new ListGrid();  
        DiplomaGrid.setWidth(500);  
        DiplomaGrid.setHeight(224);  
        DiplomaGrid.setShowAllRecords(true);  
        DiplomaGrid.setCanEdit(true);  
        DiplomaGrid.setEditEvent(ListGridEditEvent.CLICK);  
        DiplomaGrid.setModalEditing(true);  

        DiplomaData dd= new DiplomaData(funcM);

        ListGridField nameField = new ListGridField("name", "Project Name");  
        ListGridField diplomantsField = new ListGridField("diplomants", "Diplomants");  
        ListGridField leaderField = new ListGridField("leader", "Leader");   
        ListGridField reviewerField = new ListGridField("reviewer", "Reviewer");  
        ListGridField typeField = new ListGridField("type", "Type"); 
        ListGridField dateField = new ListGridField("date", "Date");
        DiplomaGrid.setFields(new ListGridField[] {nameField, diplomantsField, leaderField,reviewerField, typeField, dateField});  
        DiplomaGrid.setData(dd.getRecords());

        RootPanel.get("mainDiv").add(DiplomaGrid);
    }  

the web.xml:

<servlet>
    <servlet-name>defenceServiceImpl</servlet-name>
    <servlet-class>org.elsys.salvation.server.DefenceServiceImpl</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>defenceServiceImpl</servlet-name>
    <url-pattern>/salvation/defences</url-pattern>
  </servlet-mapping>

When I run it in developement mode it’s running but when I call the showDefence() method I can’t retrieve the serialised on the server data. Can someone tell where is the problem?

  • 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-04T06:34:10+00:00Added an answer on June 4, 2026 at 6:34 am

    On the server-side, you’re modifying the FM, but yuo don’t send it back to the client: that won’t work. Object passing between client and server is by copying (serialize→deserialize), so making a change on the server will only impact the server-side copy. You cannot update an object y sending it to the server; you’re sending a copy of it, and the server must then send back another copy with the changes applied.

    In other words, for your code, change the methods’ return type from void to FM, have the server return the FM passed a argument, and on the client-side, in the onSuccess methods, update your singleton object with the result (in the callback from setHardDefences, set the FM’s hardDefences with the hardDefences from the FM returned by the server; and similarly for the other defences).

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I want to construct a data frame in an Rcpp function, but when I
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build

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.