Trouble With Picking up the Window Closing
A friend and I are using GWT to write a game of Battleship, with two players who's information, such as ships and who's turn it is, is all stored on the server. We are trying to prepare for the case of one player leaving the game before it is finished, and have so far only come across the WindowCloseListener, which is decipricated, and isn't being called anyways. Does anyone know of a better way to end the game and clear the server one one client closes the window? Please and Thank you. -Ax -- 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-tool...@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.
AccessControlExeption: Access Denied
Hey, Personlly, as a programmer, I enjoy having control. I don't like to hear that I cant access a file. here's a bit of the background on the issue. I have to read quite a bit of information off of a .txt file, which I wrote and placed into the WEB-INF folder. That information is then read as follows, on the server side. public void loadWords(String listName) { wordList = new TreeMap>(); try { BufferedReader in = new BufferedReader(new FileReader("/war/WEB-INF/" + listName + ".txt")); String lineOfText; String[] items; int count = 0; while ((lineOfText = in.readLine()) != null) { count++; ArrayList fWords = new ArrayList(); items = lineOfText.split(", "); String word = items[0]; for(int i = 1; i < items.length; i++){ fWords.add(items[i]); } wordList.put(word, fWords); System.out.println(word + " " + fWords + " " + count); } in.close(); } catch (FileNotFoundException e) { System.out.println("no file found"); e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } I felt that this was decently simple, and have done it before. However, i get the following error: Sep 24, 2009 1:52:51 PM com.google.appengine.tools.development.ApiProxyLocalImpl log SEVERE: [125380037114] javax.servlet.ServletContext log: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract void jake.rocks.taboo.client.GreetingService.loadWords (java.lang.String)' threw an unexpected exception: java.security.AccessControlException: access denied (java.io.FilePermission \war\WEB-INF\EasyList.txt read) at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure (RPC.java:360) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse (RPC.java:546) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall (RemoteServiceServlet.java:166) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost (RemoteServiceServlet.java:86) .. Any thoughts? I have done some searching but cannot seem to find a definite answer as to what the problem is, or how to fix it. Again, this code is all on the server side. Help? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: @RemoteServiceRelativePath
I have this tag: On Sep 1, 1:43 pm, Thad wrote: > Do you have the proper servlet and servlet-mapping tags in your > web.xml? > > On Sep 1, 10:31 am, Aximilli302 wrote: > > > > > Me again, I have another quick question for the general comunity. > > > What goes into the @RemoteServiceRelativePath tag? Is it the name of > > the class it is in? for example, > > > package com.google.tabs.client; > > > import com.google.gwt.user.client.rpc.RemoteService; > > import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; > > @RemoteServiceRelativePath("MyService") > > > public interface MyService extends RemoteService{ > > > public String myMethod(String s, String username); > > > } > > > I put that in, and the server call fails. I get a warning: > > > Sep 1, 2009 9:24:28 AM > > com.google.appengine.tools.development.LocalResourceFileServlet doGet > > WARNING: No file found for: /tabs/MyService > > > Does anyone know how to make this work?- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: @RemoteServiceRelativePath
I have the following tag: On Sep 1, 1:43 pm, Thad wrote: > Do you have the proper servlet and servlet-mapping tags in your > web.xml? > > On Sep 1, 10:31 am, Aximilli302 wrote: > > > > > Me again, I have another quick question for the general comunity. > > > What goes into the @RemoteServiceRelativePath tag? Is it the name of > > the class it is in? for example, > > > package com.google.tabs.client; > > > import com.google.gwt.user.client.rpc.RemoteService; > > import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; > > @RemoteServiceRelativePath("MyService") > > > public interface MyService extends RemoteService{ > > > public String myMethod(String s, String username); > > > } > > > I put that in, and the server call fails. I get a warning: > > > Sep 1, 2009 9:24:28 AM > > com.google.appengine.tools.development.LocalResourceFileServlet doGet > > WARNING: No file found for: /tabs/MyService > > > Does anyone know how to make this work?- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
@RemoteServiceRelativePath
Me again, I have another quick question for the general comunity. What goes into the @RemoteServiceRelativePath tag? Is it the name of the class it is in? for example, package com.google.tabs.client; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; @RemoteServiceRelativePath("MyService") public interface MyService extends RemoteService{ public String myMethod(String s, String username); } I put that in, and the server call fails. I get a warning: Sep 1, 2009 9:24:28 AM com.google.appengine.tools.development.LocalResourceFileServlet doGet WARNING: No file found for: /tabs/MyService Does anyone know how to make this work? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: File Not Found While working with RPC
That is there. Myservice looks like this: public interface MyService extends RemoteService{ public String myMethod(String s, String username); } MyServiceAsync looks like this: public interface MyServiceAsync { public void myMethod(String s, String username, AsyncCallback callback); } MyServiceImpl looks like this: public class MyServiceImpl extends RemoteServiceServlet implements MyService { public String myMethod(String s, String username) { System.out.println("into myMethod, in the impl class"); s="It got to the server and was returned as this. The user is: " + username; return s; } On Aug 31, 9:53 am, Rahul wrote: > Hi, > There should be another class called MyServiceAsync.java under client > > On Aug 31, 10:41 am, Aximilli302 wrote: > > > > > The Exact error is: > > > Aug 31, 2009 9:37:02 AM > > com.google.appengine.tools.development.LocalResourceFileServlet doGet > > WARNING: No file found for: /MyService > > > On Aug 31, 9:38 am, Aximilli302 wrote: > > > > Hello all, > > > > I'm having a slight issue with making server calls. I have set up a > > > relitivly simple server, but am new to this, and have gotten most of > > > what i've learned off the internet. > > > > At this point, the error is that the server can not be found. Here are > > > a few tidbits of my code, where the issue likely lies. > > > > //Inside the Main Class > > > ServiceDefTarget endpoint = (ServiceDefTarget) myService; > > > > endpoint.setServiceEntryPoint("/MyService"); > > > > myService.myMethod(lbl.getText(), user.getUserName(), new > > > AsyncCallback() { > > > > @Override > > > public void onFailure(Throwable caught) { > > > System.out.println("Into the onfailure method"); > > > lbl.setText("Failure to send"); > > > System.out.println(caught.getCause()); > > > } > > > > @Override > > > public void onSuccess(String a) { > > > System.out.println("Sucess"); > > > //Does everthing it's supposed to > > > } > > > }); > > > > I have the MyService interface, and the MyServiceAsync. > > > The MyServiceImpl class returns a simple String > > > > The XML class contains the following lines: > > > > > > > > class="com.google.tabs.server.MyServiceImpl" /> > > > > MyService is inside the .client class, while MyServiceImpl is > > > inside .server > > > > Any thoughts?- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: File Not Found While working with RPC
The Exact error is: Aug 31, 2009 9:37:02 AM com.google.appengine.tools.development.LocalResourceFileServlet doGet WARNING: No file found for: /MyService On Aug 31, 9:38 am, Aximilli302 wrote: > Hello all, > > I'm having a slight issue with making server calls. I have set up a > relitivly simple server, but am new to this, and have gotten most of > what i've learned off the internet. > > At this point, the error is that the server can not be found. Here are > a few tidbits of my code, where the issue likely lies. > > //Inside the Main Class > ServiceDefTarget endpoint = (ServiceDefTarget) myService; > > endpoint.setServiceEntryPoint("/MyService"); > > myService.myMethod(lbl.getText(), user.getUserName(), new > AsyncCallback() { > > @Override > public void onFailure(Throwable caught) { > System.out.println("Into the onfailure method"); > lbl.setText("Failure to send"); > System.out.println(caught.getCause()); > } > > @Override > public void onSuccess(String a) { > System.out.println("Sucess"); > //Does everthing it's supposed to > } > }); > > I have the MyService interface, and the MyServiceAsync. > The MyServiceImpl class returns a simple String > > The XML class contains the following lines: > > class="com.google.tabs.server.MyServiceImpl" /> > > MyService is inside the .client class, while MyServiceImpl is > inside .server > > Any thoughts? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
File Not Found While working with RPC
Hello all, I'm having a slight issue with making server calls. I have set up a relitivly simple server, but am new to this, and have gotten most of what i've learned off the internet. At this point, the error is that the server can not be found. Here are a few tidbits of my code, where the issue likely lies. //Inside the Main Class ServiceDefTarget endpoint = (ServiceDefTarget) myService; endpoint.setServiceEntryPoint("/MyService"); myService.myMethod(lbl.getText(), user.getUserName(), new AsyncCallback() { @Override public void onFailure(Throwable caught) { System.out.println("Into the onfailure method"); lbl.setText("Failure to send"); System.out.println(caught.getCause()); } @Override public void onSuccess(String a) { System.out.println("Sucess"); //Does everthing it's supposed to } }); I have the MyService interface, and the MyServiceAsync. The MyServiceImpl class returns a simple String The XML class contains the following lines: MyService is inside the .client class, while MyServiceImpl is inside .server Any thoughts? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Forcing a TextArea to scroll
Works beautifully. Thanks! On Aug 21, 1:39 pm, mdwarne wrote: > I'm not sure about a textarea. > > But you can do this using a ScrollPanel. > > You can add a FlowPanel to your ScrollPanel. > All your text messages can be Label Widgets that you Add to your Flow > Panel. > > After adding the Label Widget you can call: > > scrollPanel.scrollToBottom(); > > Or... > scrollPanel.ensureVisible(someWidget) > > I am doing something similar with a scrollable form, if there is a > data entry error, I can scroll to the field in error and display it to > the user. > > Thanks, > Mike. > > That will force the > > On Aug 20, 3:53 am, Aximilli302 wrote: > > > > > Hello all! > > > I am trying to make a text area scroll. I am trying to simulate a type > > of chat room envirement, where the user types into a text box, presses > > enter, then the text apears into a read only text area, with the text > > aera auto scrolling to the bottom. Is there a way to make the read > > only text area scroll? > > > Here is some of my code. > > > private TextBox text = new TextBox(); > > private Button enter = new Button("Enter"); > > private TextArea textArea = new TextArea(); > > > textArea.setReadOnly(true); > > textArea.setVisibleLines(5); > > > text.addKeyPressHandler(new KeyPressHandler){ > > public void onKeyPress(KeyPressEvent event) { > > if (event.getCharCode() == KeyCodes.KEY_ENTER) { > > enterClicked(); > > } > > } > > }); > > > private void enterClicked(){ > > String previousText = textArea.getText(); > > String newText = previousText + "\n" + text.getText(); > > textArea.setText(newText); > > text.setText(""); > > text.setFocus(true); > > } > > > Any help would be awesome. Thanks!- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Forcing a TextArea to scroll
Hello all! I am trying to make a text area scroll. I am trying to simulate a type of chat room envirement, where the user types into a text box, presses enter, then the text apears into a read only text area, with the text aera auto scrolling to the bottom. Is there a way to make the read only text area scroll? Here is some of my code. private TextBox text = new TextBox(); private Button enter = new Button("Enter"); private TextArea textArea = new TextArea(); textArea.setReadOnly(true); textArea.setVisibleLines(5); text.addKeyPressHandler(new KeyPressHandler){ public void onKeyPress(KeyPressEvent event) { if (event.getCharCode() == KeyCodes.KEY_ENTER) { enterClicked(); } } }); private void enterClicked(){ String previousText = textArea.getText(); String newText = previousText + "\n" + text.getText(); textArea.setText(newText); text.setText(""); text.setFocus(true); } Any help would be awesome. Thanks! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Referencing other projects
Good day all. I'm having a slight issue with what was(hopefully) to be a simple application using GTW. All I am doing is creating a button which, when clicked, refences another project I have created, to play a pacman game. Here is the click handler for the button. public void onClick(ClickEvent event) { new StartMenu(); } StartMenu is the opening class, which creates a new JFrame, and begins the game. I have imported the project already, however, I have recieved the following error- No source code is available for type Gui.StartMenu; did you forget to inherit a required module? Note- Gui is the package The source code is there, as I can look at it. Any thoughts? Oh, I also use eclipse, so if that makes a difference. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---