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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:08:43+00:00 2026-05-18T08:08:43+00:00

Im making my own application by using GWT framework. I say that many Class

  • 0

Im making my own application by using GWT framework. I say that many Class are not supported (like Calendar, Connection, Statement, DriverManager, ResultSet, etc etc) but i can use it (they works).

Is it normal? 🙂 And should they be replaced?

EXAMPLE :

when application start, it loads some FlowPanel with some buttons. When i click on the menu_login_button i do the asynch call

package org.sinfonet.client;

public class PageMenuLogin extends FlowPanel {
    private PageCenter center;
    public PageMenuLogin(PageCenter center) {
        this.center=center;
        designLogin();
    }

    public void designLogin() {
        final InlineLabel menu_login_label1=new InlineLabel("Username");
        menu_login_label1.setStyleName("menu_span");
        this.add(menu_login_label1);
        final TextBox menu_login_input1 = new TextBox();
        menu_login_input1.setText("admin");
        this.add(menu_login_input1);
        final InlineLabel menu_login_label2=new InlineLabel("Password");
        menu_login_label2.setStyleName("menu_span");
        this.add(menu_login_label2);
        final TextBox menu_login_input2 = new TextBox();
        menu_login_input2.setText("pass");
        this.add(menu_login_input2);
        Button menu_login_button=new Button("Login");
        this.add(menu_login_button);

        PageMenuLogin.this.center.getContent().clear();
        PageMenuLogin.this.center.getContent().add(new TitleContent("Homepage"));
        PageMenuLogin.this.center.getContent().add(new Main());

        final AsyncCallback<java.lang.Boolean> callCheckLogin = new AsyncCallback<java.lang.Boolean>() {
            public void onSuccess(Boolean result) {
                if(result) {
                    designLogout(menu_login_input1.getText());
                } else {
                    menu_err.setText("Username e password non validi");
                }
            }

            public void onFailure(Throwable caught) {
                menu_login_label1.setText("Comunicazione Fallita");
            }
        };

        menu_login_button.addClickHandler(new ClickHandler(){
            public void onClick(ClickEvent event) {
                getService().checkLogin(menu_login_input1.getText(), menu_login_input2.getText(), callCheckLogin);
            }
        });
    }

    public void designLogout(String login_user) {
        PageMenuLogin.this.center.getContent().add(new Profile(login_user));
    }

    public static GWTServiceAsync getService() {
        return GWT.create(GWTService.class);
    }
}

right now, under you can see the asynch call, where (as you said) i can put every kind of server calls (database, resultset, statement, ecc)

package org.sinfonet.server;

public class GWTServiceImpl extends RemoteServiceServlet implements GWTService {
    public boolean checkLogin(String nickname, String password) {
        Database mydb=Configuration.getDatabase();
        mydb.connetti();

        // faccio md5 ed escape
        String log_check_user=nickname;
        String log_check_pass=password;

        // controllo che l'utente esista
        ArrayList<String[]> db_result=null;
        db_result=mydb.selectQuery("SELECT nickname FROM users WHERE nickname='"+log_check_user+"' AND password='"+log_check_pass+"'");
        if(db_result.size()!=0) {
            return true;
        }

        // sconnessione al database
        mydb.disconnetti();

        return false;
    }
}

if the function return true, i can load the Profile class (which is client side).

package org.sinfonet.client.profile;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.TextBox;
import org.sinfonet.server.mgmt.Configuration;
import org.sinfonet.server.mgmt.Database;

public class Profile extends FlowPanel {
    private String[] record;
    private String value;
    private TextBox field_1, field_2, field_3, field_4, field_5;
    private TextArea field_A;

    private FlowPanel profilo_1=new FlowPanel();
    private FlowPanel profilo_2=new FlowPanel();
    private FlowPanel profilo_3=new FlowPanel();
    private FlowPanel pm_inbox=new FlowPanel();
    private FlowPanel pm_outbox=new FlowPanel();
    private FlowPanel pm_button=new FlowPanel();

    public Profile(String value) {
        // memorizzo nome utente
        this.value=value;

        // imposto div principale
        this.setStyleName("content_span");
        profilo_1.setStyleName("profilo_1");
        profilo_2.setStyleName("profilo_2");
        profilo_3.setStyleName("profilo_3");
        pm_inbox.setStyleName("pm_cont1");
        pm_outbox.setStyleName("pm_cont2");
        pm_button.setStyleName("pm_but");
        this.add(profilo_1);
        this.add(profilo_2);
        this.add(profilo_3);
        designMainProfile();
    }

    public final void designMainProfile() {
        Database mydb=Configuration.getDatabase();

        mydb.connetti();
        mydb.disconnetti();
    }
}

If i well understand, i can’t call Database functions when i load Profile (because its a client class).

So, how can i fix it? I do an asynch call when im loading Profile?

  • 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-18T08:08:44+00:00Added an answer on May 18, 2026 at 8:08 am

    A couple of pointers first.

    1. Never include anything in *.server
      in a class in *.client.
    2. The opposite of the above is also
      true: never include anything in
      *.client in a class in *.server.
    3. The server end points of gwt rpc’s
      are in *.server, and end in Impl.
      They can do server things.
    4. The client end points of gwt rpc’s
      are in *.client, and one of them
      ends in Async. The other isn’t
      appended with anything. These two
      files are interfaces, and therefore
      have no logic.

    replace callCheckLogin in PageMenuLogin with the following:

    public class PageMenuLogin extends FlowPanel {
    ...
      public void designLogin() {
            final InlineLabel menu_login_label1 = new InlineLabel("Username");
            menu_login_label1.setStyleName("menu_span");
            this.add(menu_login_label1);
            final TextBox menu_login_input1 = new TextBox();
            menu_login_input1.setText("admin");
            this.add(menu_login_input1);
            final InlineLabel menu_login_label2 = new InlineLabel("Password");
            menu_login_label2.setStyleName("menu_span");
            this.add(menu_login_label2);
            final TextBox menu_login_input2 = new TextBox();
            menu_login_input2.setText("pass");
            this.add(menu_login_input2);
            Button menu_login_button = new Button("Login");
            this.add(menu_login_button);
    
            this.center.getContent().clear();
            this.center.getContent().add(new TitleContent("Homepage"));
            this.center.getContent().add(new Main());
    
            menu_login_button.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    getService().checkLogin(menu_login_input1.getText(),
                            menu_login_input2.getText(),
                            new AsyncCallback<Boolean>() {
    
                                @Override
                                public void onFailure(Throwable caught) {
                                    menu_login_label1
                                            .setText("Comunicazione Fallita");
                                }
    
                                @Override
                                public void onSuccess(Boolean result) {
                                    if (result) {
                                        designLogout(menu_login_input1.getText());
                                    } else {
                                        menu_err.setText("Username e password non validi");
                                    }
                                }
                            });
                }
            });
        }
    

    replace designMainProfile in Profile with the following:

        public final void designMainProfile() {
    
            PageMenuLogin.getService().foo(new AsyncCallback<Void>() {
    
                @Override
                public void onFailure(Throwable caught) {
                    // TODO Auto-generated method stub
    
                }
    
                @Override
                public void onSuccess(Void result) {
                    // TODO Auto-generated method stub
    
                }
            });
    
        }
    

    In GWTServiceImpl, add the following:

    @Override
        public void foo() {
            Database mydb = Configuration.getDatabase();
    
            mydb.connetti();
            mydb.disconnetti();
    
        }
    

    In GWTService, add the following:

    void foo();
    

    In GWTServiceAsync, add the following:

    void foo(AsyncCallback<Void> asyncCallback);
    

    If you don’t have either of the last two classes, let me know, and we’ll back up a couple steps.

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

Sidebar

Related Questions

I have completed the MVC Music Store application, and now am making my own
I am making a web application for a company that records data in the
I'm making an application that will monitor the state of another process and restart
I am making an application using c#.net. The application relies on a PostgrSQL ODBC
I'm using Qt framework which has by default non-blocking I/O to develop an application
I am making a linux application using C++ and it will print info out
In my application I am using my own theme based on the Theme.Holo.Light However
I am making a WP7 Silverlight application and using a ViewModel to store the
I'm using the PHP SDK from facebook in my own application. When I retrieve
So I have an ASP.NET web site (not web application) I'm making in VS2010

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.