gwt

Can't read property file on Server side with GWT

梦想与她 提交于 2019-12-25 04:27:06
问题 I want to read property file on Server side. I have DBConfig.java, useDBConfig.java and DBConfig.properties all placed in server package. I can't read the values from property file on Server Side. Your help is highly appreciated. public interface DBConfig extends Constants { @DefaultStringValue("host") String host(String host); @DefaultStringValue("port") String port(String port); @DefaultStringValue("username") String username(String username); @DefaultStringValue("password") String password

Using Restlet ClientResource cannot send entity to Restlet Service

♀尐吖头ヾ 提交于 2019-12-25 04:26:34
问题 I'm having problem with Restlet client call to a working rest service: final ClientResource resource = new ClientResource(Routes.PUBLIC_STORE_API); resource.setOnResponse(new Uniform() { public void handle(Request request, Response response) { try { Status status = response.getStatus(); if(!Status.isError(status.getCode())){ String jsonResponse = response.getEntity().getText(); } else { // Handle error } } catch (Exception e){ callback.failure(new Throwable(e.getMessage())); } } });

How to upload only images in GWT fileUpload

纵然是瞬间 提交于 2019-12-25 04:24:21
问题 I need to upload one image file into my application. I am using GWT FileUpload compontent to upload the File. But when I use FileUpload, the FileUploadDialog displayed All files.. I need to set it only for image files . How can I set filter for that? Thanks, Ajinkya. 回答1: HTML <input> has accept Attribute http://www.w3schools.com/tags/att_input_accept.asp do like this on GWT FileUpload upload=new FileUpload(); upload.getElement().setAttribute("accept", "image/*"); 来源: https://stackoverflow

Issue with calling instance method from handwritten javascript

偶尔善良 提交于 2019-12-25 04:15:19
问题 Can anyone help with what is wrong in the code below(based on the answers to a similar question asked on SO): public String javaMethod(String input) { return "it works"; } public native void defineBridgeMethod() /*-{ var that = this; $wnd.jsFunction= $entry(function(msg) { that.@com.myclass.ClassName::javaMethod(Ljava/lang/String;)(msg) }); }-*/; The issue is that Javascript does not find jsFunction: alert(jsFunction) in Javascript code returns 'undefined'. Thanks. Edit: Huh, one hour later:

Saving GWT form data into different application

不羁岁月 提交于 2019-12-25 04:10:22
问题 I have a GWT application which has form. If user enters data and submit i have to store the data into google datastore and also an JSP application which is running on tomcat server. I found this is done through Task in GAE GAE Push Task from this i am calling a servlet in my gwt application and in that servlet URL fetch There i have to code to send data to another application and call the servlet to insert data. Can anyone give me how to do it(By a simple example). Is this a correct approach

404 error when running a GWT program in Eclipse. Seems to be to do with servlet mapping

你。 提交于 2019-12-25 04:09:19
问题 I have a GWT project which has been working fine for many weeks. On opening the code yesterday I found dozens of big red errors in my code. I've seen this happen before and have learnt, after much frustration, that all I need to is clean the project for Eclipse to be happy again, so I did that. Fine. However, when I run the thing, I get a 404 error saying this: type Status report message /LittleRedGarden/littleredgarden/greet description The requested resource (/LittleRedGarden

404 error when running a GWT program in Eclipse. Seems to be to do with servlet mapping

☆樱花仙子☆ 提交于 2019-12-25 04:08:51
问题 I have a GWT project which has been working fine for many weeks. On opening the code yesterday I found dozens of big red errors in my code. I've seen this happen before and have learnt, after much frustration, that all I need to is clean the project for Eclipse to be happy again, so I did that. Fine. However, when I run the thing, I get a 404 error saying this: type Status report message /LittleRedGarden/littleredgarden/greet description The requested resource (/LittleRedGarden

Displaying a Widget in a new Window in GWT

戏子无情 提交于 2019-12-25 04:05:27
问题 I have a requirement wherein I need to display a drag n drop cell table in a new window. I have checked for answers and I have googled about this, but I did not get appropriate answers. I am able to open a new window on click of a button. Following is the code which I am using: @UiHandler(value = { "buttonReleaseView" }) void onReleaseViewClick(ClickEvent clickEvent) { String winUrl = GWT.getModuleBaseURL() + "releaseView/"; String winName = "Release View"; openNewWindow (winName, winUrl); /*

GWTP: onUnbind() never called after closing a presenter

只谈情不闲聊 提交于 2019-12-25 03:29:32
问题 I have a GWTP MyPresenter that registers a handler at onBind(), and it works perfectly. The problem is when I leave the presenter using the BACK arrow on the browser. The onUnbind() is never called (I tried with an breakpoint overriding the method, but is never executed). So that this handler is never unregistered. What is wrong? Thanks. public class MyPresenter extends PresenterWidget<ViewDiagramPresenter.MyView> { [...] @Override protected void onBind() { super.onBind(); registerHandler

GWT Error: “The output stream has been committed and can no longer be written to”

妖精的绣舞 提交于 2019-12-25 03:27:15
问题 New to Java and GWT. Here is my problem. I am getting this error message: "The OutputStream has been committed and can no longer be written to." while I am trying to post xml to a remote server via REST API. It is happening on this line in the code below: out.write("Content-Type: application/x-www-form-urlencoded\r\n"); This works from terminal: curl -d "OPERATION_NAME=ADD_REQUEST&TECHNICIAN_KEY=DxxxxxxxxxxxxxxxxxxxB6&INPUT_DATA=<?xml version=%221.0%22 encoding=%22utf-8%22?><Operation>