Re: How to call a compiler in server side

2010-03-16 Thread jmpeace
check out beanshell, maybe it provides the functionality you are
looking for.


On Mar 15, 11:25 am, duclm duclm...@gmail.com wrote:
 I'm implement a application to compile code online, i must call a
 execute file(compiler) with the first parameter is name of source
 file, but i hear that we can't save file with GAE, so i can't call the
 compiler, do you have any solution for this problem ?
 And have a question, can i call Runtime.getRuntime().exec and get
 return String, i hear that GAE don't support java.io

-- 
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.



Re: GWT list box onChange event not triggerd

2009-12-17 Thread jmpeace
Hi,

I am having the same issue but only when I use the keyboard to change
the ListBox selected Item. If mouse is used the event is triggered as
expected.

On 17 dic, 09:17, buminda bumi...@gmail.com wrote:
 Hello ,

                 I have a list box included in one of the cell in the flex
 table . The list box is added after setting the change handler. When the
 list box is clicked and item changed after the selection , the corresponding
 event is not fired. ( i.e onChange event is not fired ) . Is there any
 reason for this to happen.

 Buminda Nawagamuwa

 Technical Team Leader
 CodeGen International (pvt) Ltd
 29, Braybrook Place, Colombo 02, Sri Lanka.
 Tel: +94 112 470 740

 Mobile: +94 777 743 805
  mailto:bumi...@codegen.net bumi...@codegen.net
  http://www.codegen.itwww.codegen.it

--

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.




Re: Is there a way so I can use ProjectRun AsRun on Server functionality while using the new GWT eclipse plugin?

2009-09-09 Thread jmpeace

Thanks for your answer Jason.

I was previously using cypal studio because it makes it easy for you
to deploy your compiled code (HTML  CSS) and java clases (Servlets)
to a local server in the traditional Eclipse way.  (Run As  Run on
Server).

I've put almost all of my GWT client and server code inside a JAR, and
my team use this jar to build products using this jar as their core.
The team members simply make extensions to server classes, they are
not involved in changes to the UI (GWT) code.

The team uses WEB MODE only, because of performance reasons.

My original question was, how could I deploy the war directory to a
server inside eclipse?

Thank you very much for your attention.

joe



On 17 ago, 11:09, Jason Parekh jasonpar...@gmail.com wrote:
 Hi jmpeace,
 Could you explain your use case a bit more (so in the future, we can better
 support it.)

 My understanding is you'd like to do infrequent GWT compiles and package
 this into a WAR and run it on a server.  Is the server GWT's jetty instance
 or your own app server?

 You may be able to use Keith's instructions 
 fromhttp://groups.google.com/group/Google-Web-Toolkit/msg/9ce13140f71e2100if
 you want to run this on your own app server.

 Thanks,
 jason



 On Fri, Aug 14, 2009 at 4:14 PM, jmpeace jmpe...@gmail.com wrote:

  I've been using Cypal Studio so far, as it provides this
  functionality.  Is there a way to do that with the new plug in?  How
  could I launch the project in web mode without compiling every time?

  I have this situation since the client side of my app is almost
  finished and I don't really need to transcode it very often.

  Any suggestion would be greatly appreciated.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Is there a way so I can use ProjectRun AsRun on Server functionality while using the new GWT eclipse plugin?

2009-08-14 Thread jmpeace

I've been using Cypal Studio so far, as it provides this
functionality.  Is there a way to do that with the new plug in?  How
could I launch the project in web mode without compiling every time?

I have this situation since the client side of my app is almost
finished and I don't really need to transcode it very often.

Any suggestion would be greatly appreciated.
--~--~-~--~~~---~--~~
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: Sending email from Server Side

2009-05-13 Thread jmpeace

you could use another thread so that the operation doesn't block your
application, or maybe to implement retries.

public static void sendMessage(final String smtpHost,final String
fromAddress,
final String fromName,final String to,final String 
subject,final
String text){

new Thread(){
  public void run()
   {
// Get system properties
Properties properties = System.getProperties();
// Setup mail server
properties.put(mail.smtp.host, smtpHost);
// Get session
Session session = Session.getDefaultInstance(properties,
null);
// Define message
MimeMessage message = new MimeMessage(session);
// Set the from address
try {
message.setFrom(new 
InternetAddress(fromAddress, fromName));
// Set the to address
message.addRecipient(Message.RecipientType.TO, 
new
InternetAddress(to));
// Set the subject
message.setSubject(subject);
// Set the content
message.setContent(text, text/html);
// Send message
Transport.send(message);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (MessagingException e) {
e.printStackTrace();
}

}
};


}
--~--~-~--~~~---~--~~
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: Sending email from Server Side

2009-05-13 Thread jmpeace

I missed one line:

public static void sendMessage(final String smtpHost,final String
fromAddress,
final String fromName,final String to,final String 
subject,final
String text){

 Thread mailingThread = new Thread(){
public void run()
{
// Get system properties
Properties properties = System.getProperties();
// Setup mail server
properties.put(mail.smtp.host, smtpHost);
// Get session
Session session = Session.getDefaultInstance(properties,
null);
// Define message
MimeMessage message = new MimeMessage(session);
// Set the from address
try {
message.setFrom(new 
InternetAddress(fromAddress, fromName));
// Set the to address
message.addRecipient(Message.RecipientType.TO, 
new
InternetAddress(to));
// Set the subject
message.setSubject(subject);
// Set the content
message.setContent(text, text/html);
// Send message
Transport.send(message);
System.out.println(Mail sent to  + to);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (MessagingException e) {
e.printStackTrace();
}

}
};

mailingThread.start();


}
--~--~-~--~~~---~--~~
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: Synchornous GWT, how can i do that

2009-03-11 Thread jmpeace

Please take a took to this code
I have written this code to be able to make RPC calls one after
another:

(you can use 'result' value to know if you can continue to next call)

/*ONE*/CustomWaitingOperation.execute(new
CustomWaitingOperation.ResultCallback(){
public void onResult(boolean result, Throwable caught) {
if(result)
{

/*TWO*/CustomWaitingOperation.execute(new
CustomWaitingOperation.ResultCallback(){
public void onResult(boolean result, Throwable 
caught) {
if(result)
{


}
}
});

}
}
});

CustomWitingOperation.java

public class CustomWaitingOperation {

/*Fields*/

public interface ResultCallback {
void onResult(boolean result,Throwable caught);
  }

public CustomWaitingOperation(/*Parameters Here*/) {
/*Fields=Parameters*/
}

public void onResponse(boolean result,Throwable caught) {
return;
}

public static void execute(/*Parameters Here*/,final ResultCallback
resultCallback){

final AppServicesAsync serviceProxy = 
AppParameters.getServiceProxy
();

final CustomWaitingOperation wait = new CustomWaitingOperation(/
*Parameters Here*/){

  @Override
  public void onResponse(boolean result,Throwable caught) {
resultCallback.onResult(result, caught);
  }
};

AsyncCallbackTempObject callback = new 
AsyncCallbackTempObject()
{

public void onFailure(Throwable caught) {
GWT.log(RPC error!, caught);
wait.onResponse(false, caught);//do not 
continue
}

public void onSuccess(final TempObject result) {
wait.onResponse(true, null);//continue
}

}

serviceProxy.executeCustomOperation(/*RPC call arguments*/,
callback);


}


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



How could I compress contents of a GWT-RPC response

2009-02-19 Thread jmpeace

Hi! I am developing an application which sends big amounts of text to
the client via a GWT-RPC.  I wonder if there is a way to compress the
text in the server and decompress it on the client. What do you think
about this?
--~--~-~--~~~---~--~~
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: How could I compress contents of a GWT-RPC response

2009-02-19 Thread jmpeace

Thank very much you for the quick answers.  It's good to know it is
already done :o).

--~--~-~--~~~---~--~~
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: Servlets and web.xml

2009-02-07 Thread jmpeace

Why don't you try opening a separated browser window and point to
http://localhost:/FileServlet

It should give you a HTTP Status 500 error meaning it is listening
there in hosted mode

On Feb 7, 8:05 am, Jonathan jonathan.delf...@gmail.com wrote:
 Hi,
 Thanks again for the help.

 GWT.getModuleBaseURL() returnshttp://localhost:8080/com.tergwt.Main/
 so i guess the path is correct...
 I tried to put the hardcoded path to my app folder (/home/jon/
 GWTDeploy/webapps/com.tergwt.Main + /FileServlet) and i still get this
 404.
 I even tried to point it to the classes folder ...

 I'm not sure to understand very well in what involves this setAction
 line. It should point to my FileServlet.class file ?
 Or something else ?

 This servlet/form works fine in the embedded tomcat in hosted browser.
 So i guess something between the two config is missing (in my jetty
 server)
 But i can't find what ! It's quite annoying :)

 Thanks in advance...
 Regards

 On 7 fév, 01:59, Jonathan jonathan.delf...@gmail.com wrote:

  Hey i just saw this before your message.
  But even with that, it stills not working.
  I still get this message 404pRequestURI=/com.tergwt.Main//
  FileServlet/ppismall...

  And i changed my formAction to form.setAction(/FileServlet); instead
  of form.setAction(GWT.getModuleBaseURL() + /FileServlet);
  So now, no more idea on my side ...

  Cheers

  On 7 fév, 01:50, Shawn Brown big.coffee.lo...@gmail.com wrote: Well you 
  have to specify a valid url.

   You are configuring /fileServlet to go to your servlet and then asking
   requesting a url of /FileServlet.

   Aren't you?  I am not sure but think capitalization is significant.

   Best,

   Shawn

   On Sat, Feb 7, 2009 at 9:42 AM, Jonathan jonathan.delf...@gmail.com 
   wrote:

Wow, i'm almost happy !
I finally managed to get rid of the HTTP ERROR 503.
I misplaced the bin files (.classes), they need to be under yourapp/
web-inf/classes/...
So i took the time to copy libs here too (in lib folder).

OK this done, i don't success to upload my file.
I browse it correctly, but when i click submit i get : h2HTTP ERROR:
404/h2preNOT_FOUND/pre
pRequestURI=/com.tergwt.Main//FileServlet/ppismalla
href=http://jetty.mortbay.org/;Powered by 
Jetty:///a/small/i/pbr
as a response of the server.

My web.xml updated :
servlet
               servlet-namefileServlet/servlet-name
               
servlet-classcom.tergwt.server.FileServlet/servlet-class
       /servlet

       servlet-mapping
               servlet-namefileServlet/servlet-name
               url-pattern/fileServlet/url-pattern
       /servlet-mapping

My entrypoint if needed:
onModuleLoad() {
 final FormPanel form = new FormPanel();
     form.setAction(GWT.getModuleBaseURL() + /FileServlet);
...
}

If someone could tell me what's wrong, it could be nice :)

Thanks in advance,
Regards.

On 6 fév, 21:05, Jonathan jonathan.delf...@gmail.com wrote:
Hi to all,

I'm under linux and I follow this 
tutorialhttp://jeff.ourexchange.net/2008/03/01/deploying-gwt-applications-wit
I have a simple gwt application that browses for a file and upload it
using a servlet (class FileServlet extends HttpServlet).
In hosted mode (with tomcat) with the hosted browser of gwt, all works
as expected, my servlet runs fine.

I try to deploy application to a Jetty embedded server and i get a
HTTP ERROR: 503 SERVICE_UNAVAILABLE if i enable my servlet in web.xml
(under WEB-INF). Also when i run the Jetty server (in console), i get
two exceptions like  Failed startup of context
org.mortbay.jetty.webapp.webappcont...@1b9ce4b{/com.tergwt.Main,file:/
home/jon/GWTDeploy/webapps/com.tergwt.Main/}
java.lang.NullPointerException
I don't see the form of the upload.

If i disable the servlet declaration in the xml file, the server runs
without exceptions but it doesnt upload and i get h2HTTP ERROR:
404/h2preNOT_FOUND/prepRequestURI=/com.tergwt.Main//
FileServlet/p if i try...

So i guess it has something to do with the web.xml file.
Unfortunately, i don't success with it.
Here is the content of my web.xml file without the web-app marks.
       servlet
                servlet-namefileServlet/servlet-name
                
servlet-classcom.tergwt.server.FileServlet/servlet-class
        /servlet

        servlet-mapping
                servlet-namefileServlet/servlet-name
                url-pattern/files/*/url-pattern
        /servlet-mapping

I don't know what else i can do to fix this problem as i'm not an
expert with these things.
My main.java contains the upload form and it uses the FileServlet to
make the doPost().
Here is the full tree of my webapp deployed folder with the embed
Jetty server :http://filebin.ca/cjgvj/tree.txt.

Thanks in advance.

Class.forName(String) Instance

2008-11-10 Thread jmpeace

I was wondering if someone could help me out with this problem.

I need to get and object from an especific class (that extends a class
named DDOField).

I'm doing this to get a new instance according to the type requested:

HashMapString, DDOField availableFields = new HashMapString,
DDOField();

availableFields.put(simpletext,  new SimpleTextField());
availableFields.put(password,  new PasswordField());
availableFields.put(validated, new ValidatedField());
availableFields.put(richtext, new RichTextField());
availableFields.put(textarea, new TextAreaField());
availableFields.put(simpledate, new SimpleDateField());
availableFields.put(short, new ShortField());
availableFields.put(int, new IntField());
availableFields.put(long, new LongField());
availableFields.put(enum, new EnumField());
availableFields.put(boolean, new BooleanField());

type = simpletext;
DDOField field = availableFields.get(type);

That way I get the variable 'field' to point to a new instance of the
type 'simpletext' (new SimpleTextField()).  The problem is that I'm
creating 11 new instances just to use one of them.

I've tried to use Class.forName but it is not supported in GWT, also
tried GWT.Create() but it didn't work as I expected or maybe I'm doing
something wrong.

Any help with this matter will be greatly appreciated.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Class.forName(String) Instance

2008-11-10 Thread jmpeace

Thank you very much gregor, that solved my problem instantly.

On 10 nov, 15:53, gregor [EMAIL PROTECTED] wrote:
 Hi jmpeace,

 Would something along these lines help?

 public class FieldFactory {

  public enum Type {
      SIMPLETEXT, PASSWORD, VALIDATED ...etc
  }

   public static Widget makeField(Type type) {
         switch (type) {
             case (SIMPLETEXT) : return new SimpleTextField();
             case (PASSWORD) : return new PasswordField();
             // etc
       }
   }

 }

 regards
 gregor

 On Nov 10, 7:01 pm, jmpeace [EMAIL PROTECTED] wrote:

  I was wondering if someone could help me out with this problem.

  I need to get and object from an especific class (that extends a class
  named DDOField).

  I'm doing this to get a new instance according to the type requested:

  HashMapString, DDOField availableFields = new HashMapString,
  DDOField();

  availableFields.put(simpletext,  new SimpleTextField());
  availableFields.put(password,  new PasswordField());
  availableFields.put(validated, new ValidatedField());
  availableFields.put(richtext, new RichTextField());
  availableFields.put(textarea, new TextAreaField());
  availableFields.put(simpledate, new SimpleDateField());
  availableFields.put(short, new ShortField());
  availableFields.put(int, new IntField());
  availableFields.put(long, new LongField());
  availableFields.put(enum, new EnumField());
  availableFields.put(boolean, new BooleanField());

  type = simpletext;
  DDOField field = availableFields.get(type);

  That way I get the variable 'field' to point to a new instance of the
  type 'simpletext' (new SimpleTextField()).  The problem is that I'm
  creating 11 new instances just to use one of them.

  I've tried to use Class.forName but it is not supported in GWT, also
  tried GWT.Create() but it didn't work as I expected or maybe I'm doing
  something wrong.

  Any help with this matter will be greatly appreciated.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---