I am using GWT 1.5.3. How do I use Serializable? Eclipse produces an error when I try to implement Serializable. It says I need to either:
1. import java.io.Serializable 2. import sunw.io.Serializable; 3. Create a public interface Serializable Which is the right one to use? On Mar 5, 10:59 pm, Daniel Jue <teamp...@gmail.com> wrote: > What version of GWT are you using? Have you tried > > public class User implements Serializable{...} > > instead? > > On Thu, Mar 5, 2009 at 5:01 PM, fatjack1...@googlemail.com > > <fatjack1...@googlemail.com> wrote: > > > Hi Everyone, > > > Im having some issues encrypting a password. So heres my problem: > > > Basically I have a simple user name and password dialog box. I need to > > encrypt the password. It would be easy to implement if I just wanted > > to send the password over to the Server, but I need to send both the > > user name and password. So, to try and overcome this problem I have > > created a User Class as follows: > > > package com.project.client; > > > import com.google.gwt.user.client.rpc.IsSerializable; > > > public class User implements IsSerializable{ > > > private String username; > > private String password; > > > public User(String username, String password){ > > this.username = username; > > this.password = password; > > } > > > public String getUserName(){ > > return username; > > } > > > public String getPassword(){ > > return password; > > } > > } > > > Here is my code on the client side when the user clicks 'Login' > > > public void onClick(Widget sender) > > { > > User attemptedLogin = new > > User(userNameTextBox.getText(), > > passwordTextBox.getText()); > > > ServerService rpc = new ServerService(); > > rpc.checkLogin(attemptedLogin, callback); > > } > > > So, it should send over the userName and Password to the server via an > > RPC call. > > > Here is my code on the server (Incomplete at moment): > > > public ServerSQLData checkLogin(User message) > > { > > try { > > dc.openConnection(); > > > String password = message.getPassword(); > > System.out.println("password: " + password); > > > String hash = BCrypt.hashpw(password, BCrypt.gensalt()); > > } > > return result; > > } > > > However, when I run GWT it produces the following error messages: > > Analyzing 'com.project.client.ServerStatusSQLService' for serializable > > types > > Analyzing methods: > > public abstract com.project.client.ServerSQLData checkLogin > > (com.project.client.User message) > > Parameter: com.project.client.User message > > com.project.client.User > > Type 'com.project.client.User' was not serializable and > > has no concrete serializable subtypes > > > I'm guessing from the error messages I havent implemented the > > Serializable type correctly for the User class. Can someone see where > > I am going wrong? > > > Cheers for your help in advance. > > Jack --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---