Thank you Ravi Sharma for your fast answer.
I already was suggested to use this style:
 // Add an event handler to the form.
    form.addFormHandler(new FormHandler() {
      public void onSubmit(FormSubmitEvent event) {
        // This event is fired just before the form is submitted. We
can take
        // this opportunity to perform validation.
        if (tb.getText().length() == 0) {
          Window.alert("The text box must not be empty");
          event.setCancelled(true);
        }
      }

      public void onSubmitComplete(FormSubmitCompleteEvent event) {
        // When the form submission is successfully completed, this
event is
        // fired. Assuming the service returned a response of type
text/html,
        // we can get the result text here (see the FormPanel
documentation for
        // further explanation).
        Window.alert(event.getResults());
      }
    });

And now my application works ok...
But I'm having problem of sending responses from server. For example
if I want to tell my application that the file is too big please send
the image that is not bigger than 1mb.
I get something like:


 <h2>HTTP ERROR 500</h2>
<p>Problem accessing /officemanagerver1/upload. Reason:
</p><pre>    Expected a redirect, tried to write content instead.</
pre><p></p><hr><i><small>Powered by Jetty://</small></i><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
[2:20:18 PM AMST] Manvel Saroyan: Here is how I'm tring to send
information from server :
res.setContentType("text/plain");
res.getWriter().write("Hello, world");

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to