The slimbox JS lib is not working

2010-03-09 Thread Petein
Hello.

I want to be able to import the html code of another web page which is
on my web server to my gwt web app. I use this code to download the
content of a html page on my web server: http://codepad.org/aiVlWCt2

.

This is my entry point html (top part) http://codepad.org/k5zMcqJ2


where i load the js libs i want to be able to use.

This http://codepad.org/XiReL6EV

is the html file i import to my gwt
web app by using the RequestBuilder. The contents of that html file
are imported fine, but the js slimbox2 js lib is not working at all.
What can i do to solve this? When I press on one of the images the
slimbox script executes and does the animation as expected. This
behaviour happens when i dont comment out the libs from the imported
html file and I use it to my web app by using a Frame.

I don't want to use a Frame, because it makes my web page looking
nasty even if i set the Frames border equal to none. I don't want to
have java on the server side because i want to be able to find a cheap
hosting service to deploy this web app. I prefer not having a server
side at all to be honest. Please enlighten me to solve this problem.

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



JS slimbox lib doesnt execute

2010-03-09 Thread Petein
Hello.

I want to be able to import the html code of another web page which is
on my web server to my gwt web app. I use this code to download the
content of a html page on my web server: http://codepad.org/aiVlWCt2 .

This is my entry point html (top part) http://codepad.org/k5zMcqJ2
where i load the js libs i want to be able to use.

This http://codepad.org/XiReL6EV is the html file i import to my gwt
web app by using the RequestBuilder. The contents of that html file
are imported fine, but the js slimbox2 js lib is not working at all.
What can i do to solve this? When I press on one of the images the
slimbox script executes and does the animation as expected. This
behaviour happens when i dont comment out the libs from the imported
html file and I use it to my web app by using a Frame.

I don't want to use a Frame, because it makes my web page looking
nasty even if i set the Frames border equal to none. I don't want to
have java on the server side because i want to be able to find a cheap
hosting service to deploy this web app. I prefer not having a server
side at all to be honest. Please enlighten me to solve this problem.

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



GWT + Apache Commons + Jetty

2009-07-24 Thread Petein

my web app was deployd on jetty 6.1.19 but when i try to upload a file
i get this message "Can't read input file!" from my web app. The logs
say that the servlet works fine. another thing is that the web app
works fine in the google web toolkit hosted mode, as i press run from
eclipse. any ideas? why it cant find the file. the file is readable
--~--~-~--~~~---~--~~
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: gwt + email

2009-07-23 Thread Petein

Thank you for answering but the GAE is unchecked. I still continue to
get those errors. I tried many codes ive found but none of them worked
properly. I want a full example to use.

Regards

On Jul 23, 9:24 pm, Sumit Chandel  wrote:
> Hi Petein,
> I believe your use of the JavaMail API may be conflicting with the one
> provided in the AppEngine environment. From the hosted mode error log you
> posted, I noticed that you're running your application in hosted mode with
> the AppEngine DevServer. I'm guessing that you created your project with the
> Google Eclipse Plugin as a new Web Application Project. If that's the case,
> the AppEngine feature is checked on that project, and hosted mode will try
> to use
>
> I noticed that you're using the AppEngine DevServer in your hosted mode
> launch. You're likely using the Google Eclipse Plugin and created your
> project as a Web Application Project. If that's the case, and you want to
> use the AppEngine DevServer, you should remove any conflicting JARs that you
> would normally use for the Mail API as they are already provided by the
> DevServer. If you don't want to use the AppEngine DevServer, uncheck the
> AppEngine feature on your project (right-click on your project > Google >
> App Engine Settings... > Uncheck the "Use AppEngine" box > Click OK).
>
> I believe the embedded hosted mode Jetty server should be able to handle the
> JavaMail libraries that you're using in other Java projects. If this isn't
> the case, please feel free to report the errors here, as these could be due
> to misconfigured libraries, or might indicate that you need to use hosted
> mode with the -noserver option (see link below for details).
>
> How do I use my own server in hosted mode instead of GWT's built-in Jetty
> instance?:http://code.google.com/webtoolkit/doc/1.6/FAQ_DebuggingAndCompiling.h...
>
> <http://code.google.com/webtoolkit/doc/1.6/FAQ_DebuggingAndCompiling.h...>Hope
> that helps,
> -Sumit Chandel
>
> On Mon, Jul 20, 2009 at 4:07 PM, Petein  wrote:
>
> > this code works fine when i have a java app. I do have the mail.jar in
> > my path. Any ideas?
>
> > On Jul 20, 3:27 pm, "Donald W. Long"  wrote:
> > > Do you have the jar for gmail in your path?
>
> > > On Jul 19, 7:52 am, Petein  wrote:
>
> > > > Hi. I made an RPC for sending an email
>
> > > > this is the Impl file:
>
> > > > package faceRecognition.server;
>
> > > > import com.google.gwt.user.server.rpc.RemoteServiceServlet;
>
> > > > import faceRecognition.client.EmailService;
> > > > import faceRecognition.server.Email.SendMail.Gmail;
>
> > > > @SuppressWarnings("serial")
> > > > public class EmailServiceImpl extends RemoteServiceServlet implements
> > > >                 EmailService {
>
> > > >         @Override
> > > >         public String send(String emailTo, String subject, String body)
> > {
>
> > > >                 String msg = "";
>
> > > >                 msg = Gmail.send("this", emailTo, subject, body);
>
> > > >                 return(msg);
>
> > > >         }
>
> > > > }
>
> > > > when i commented out the line "msg = Gmail.send("this", emailTo,
> > > > subject, body);"
>
> > > > everything is ok. the problem is in the method Gmail.send:
>
> > > > package faceRecognition.server.Email.SendMail;
>
> > > > import java.security.Security;
> > > > import java.util.Properties;
> > > > import javax.mail.*;
> > > > import javax.mail.internet.*;
>
> > > > public class Gmail {
>
> > > >     private static final String SMTP_HOST_NAME = "smtp.gmail.com";
> > > >     private static final String SMTP_PORT = "465";
> > > >     private static final String SSL_FACTORY =
> > > > "javax.net.ssl.SSLSocketFactory";
>
> > > >     public static String send(String emailFromAddress, String sendTo,
> > > > String subject, String body){
>
> > > >         Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider
> > > > ());
>
> > > >         String[] emails = new String[1];
> > > >         emails[0] = sendTo;
> > > >         try {
> > > >             sendSSLMessage("usern...@gmail.com", "password", emails,
> > > > subject,
> > > >                     body, emailFromAdd

GWT + Deploy to jetty

2009-07-23 Thread Petein

I created the war file and put it in the web apps dir. then i started
jetty and opened firefox. wrote the address and the web page loaded
ok. then i wanted to do something which uses a servlet. i get this
error:

HTTP ERROR 404
Problem accessing /myfacerecognitionwa/upload. Reason:
Not FoundPowered by
Jetty://

Whats happening? The war file contains everything in the war dir. All
the other RPCs work fine.
--~--~-~--~~~---~--~~
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: gwt + email

2009-07-20 Thread Petein

this code works fine when i have a java app. I do have the mail.jar in
my path. Any ideas?

On Jul 20, 3:27 pm, "Donald W. Long"  wrote:
> Do you have the jar for gmail in your path?
>
> On Jul 19, 7:52 am, Petein  wrote:
>
> > Hi. I made an RPC for sending an email
>
> > this is the Impl file:
>
> > package faceRecognition.server;
>
> > import com.google.gwt.user.server.rpc.RemoteServiceServlet;
>
> > import faceRecognition.client.EmailService;
> > import faceRecognition.server.Email.SendMail.Gmail;
>
> > @SuppressWarnings("serial")
> > public class EmailServiceImpl extends RemoteServiceServlet implements
> >                 EmailService {
>
> >         @Override
> >         public String send(String emailTo, String subject, String body) {
>
> >                 String msg = "";
>
> >                 msg = Gmail.send("this", emailTo, subject, body);
>
> >                 return(msg);
>
> >         }
>
> > }
>
> > when i commented out the line "msg = Gmail.send("this", emailTo,
> > subject, body);"
>
> > everything is ok. the problem is in the method Gmail.send:
>
> > package faceRecognition.server.Email.SendMail;
>
> > import java.security.Security;
> > import java.util.Properties;
> > import javax.mail.*;
> > import javax.mail.internet.*;
>
> > public class Gmail {
>
> >     private static final String SMTP_HOST_NAME = "smtp.gmail.com";
> >     private static final String SMTP_PORT = "465";
> >     private static final String SSL_FACTORY =
> > "javax.net.ssl.SSLSocketFactory";
>
> >     public static String send(String emailFromAddress, String sendTo,
> > String subject, String body){
>
> >         Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider
> > ());
>
> >         String[] emails = new String[1];
> >         emails[0] = sendTo;
> >         try {
> >             sendSSLMessage("usern...@gmail.com", "password", emails,
> > subject,
> >                     body, emailFromAddress);
> >             return("");
> >         }catch  (Exception e) {
> >             e.printStackTrace();
> >            return(e.getMessage());
> >         }
>
> >     }
>
> >     private static void sendSSLMessage(final String username, final
> > String password, String recipients[], String subject,
> >             String message, String from) throws MessagingException {
> >         boolean debug = true;
>
> >         Properties props = new Properties();
> >         props.put("mail.smtp.host", SMTP_HOST_NAME);
> >         props.put("mail.smtp.auth", "true");
> >         props.put("mail.debug", "true");
> >         props.put("mail.smtp.port", SMTP_PORT);
> >         props.put("mail.smtp.socketFactory.port", SMTP_PORT);
> >         props.put("mail.smtp.socketFactory.class", SSL_FACTORY);
> >         props.put("mail.smtp.socketFactory.fallback", "false");
>
> >         Session session = Session.getDefaultInstance(props,
> >                 new javax.mail.Authenticator() {
>
> >                     @Override
> >                     protected PasswordAuthentication
> > getPasswordAuthentication() {
> >                         return new PasswordAuthentication(username,
> > password);
> >                     }
> >                 });
>
> >         session.setDebug(debug);
>
> >         Message msg = new MimeMessage(session);
> >         InternetAddress addressFrom = new InternetAddress(from);
> >         msg.setFrom(addressFrom);
>
> >         InternetAddress[] addressTo = new InternetAddress
> > [recipients.length];
> >         for (int i = 0; i < recipients.length; i++) {
> >             addressTo[i] = new InternetAddress(recipients[i]);
> >         }
> >         msg.setRecipients(Message.RecipientType.TO, addressTo);
>
> >         // Setting the Subject and Content Type
> >         msg.setSubject(subject);
> >         msg.setContent(message, "text/html");
> >         //Transport.send(msg);
>
> >         javax.mail.Transport.send(msg); //HERE I GET THE FOLLOWING
> > ERROR
> >     }
>
> > }
>
> > The error which i get is:
>
> > DEBUG: getProvider() returning javax.mail.Provider
> > [TRANSPORT,gm,com.google.appengine.api.mail.stdimpl.GMTransport]
> > com.google.app

gwt + email

2009-07-19 Thread Petein

Hi. I made an RPC for sending an email

this is the Impl file:

package faceRecognition.server;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

import faceRecognition.client.EmailService;
import faceRecognition.server.Email.SendMail.Gmail;

@SuppressWarnings("serial")
public class EmailServiceImpl extends RemoteServiceServlet implements
EmailService {

@Override
public String send(String emailTo, String subject, String body) {

String msg = "";

msg = Gmail.send("this", emailTo, subject, body);

return(msg);

}


}
when i commented out the line "msg = Gmail.send("this", emailTo,
subject, body);"

everything is ok. the problem is in the method Gmail.send:

package faceRecognition.server.Email.SendMail;

import java.security.Security;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;


public class Gmail {

private static final String SMTP_HOST_NAME = "smtp.gmail.com";
private static final String SMTP_PORT = "465";
private static final String SSL_FACTORY =
"javax.net.ssl.SSLSocketFactory";

public static String send(String emailFromAddress, String sendTo,
String subject, String body){

Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider
());

String[] emails = new String[1];
emails[0] = sendTo;
try {
sendSSLMessage("usern...@gmail.com", "password", emails,
subject,
body, emailFromAddress);
return("");
}catch  (Exception e) {
e.printStackTrace();
   return(e.getMessage());
}

}

private static void sendSSLMessage(final String username, final
String password, String recipients[], String subject,
String message, String from) throws MessagingException {
boolean debug = true;

Properties props = new Properties();
props.put("mail.smtp.host", SMTP_HOST_NAME);
props.put("mail.smtp.auth", "true");
props.put("mail.debug", "true");
props.put("mail.smtp.port", SMTP_PORT);
props.put("mail.smtp.socketFactory.port", SMTP_PORT);
props.put("mail.smtp.socketFactory.class", SSL_FACTORY);
props.put("mail.smtp.socketFactory.fallback", "false");

Session session = Session.getDefaultInstance(props,
new javax.mail.Authenticator() {

@Override
protected PasswordAuthentication
getPasswordAuthentication() {
return new PasswordAuthentication(username,
password);
}
});

session.setDebug(debug);

Message msg = new MimeMessage(session);
InternetAddress addressFrom = new InternetAddress(from);
msg.setFrom(addressFrom);

InternetAddress[] addressTo = new InternetAddress
[recipients.length];
for (int i = 0; i < recipients.length; i++) {
addressTo[i] = new InternetAddress(recipients[i]);
}
msg.setRecipients(Message.RecipientType.TO, addressTo);

// Setting the Subject and Content Type
msg.setSubject(subject);
msg.setContent(message, "text/html");
//Transport.send(msg);

javax.mail.Transport.send(msg); //HERE I GET THE FOLLOWING
ERROR
}
}

The error which i get is:

DEBUG: getProvider() returning javax.mail.Provider
[TRANSPORT,gm,com.google.appengine.api.mail.stdimpl.GMTransport]
com.google.apphosting.api.ApiProxy$CallNotFoundException: The API
package 'mail' or call 'Send()' was not found.
at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:70)
at com.google.appengine.api.mail.MailServiceImpl.doSend
(MailServiceImpl.java:96)
at com.google.appengine.api.mail.MailServiceImpl.send
(MailServiceImpl.java:33)
at com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage
(GMTransport.java:247)
at javax.mail.Transport.send0(Transport.java:191)
at javax.mail.Transport.send(Transport.java:120)
at faceRecognition.server.Email.SendMail.Gmail.sendSSLMessage
(Gmail.java:75)
at faceRecognition.server.Email.SendMail.Gmail.send(Gmail.java:26)
at faceRecognition.server.EmailServiceImpl.send(EmailServiceImpl.java:
17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:527)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:166)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet

Re: Servlet for uploading file

2009-07-17 Thread Petein

thanks for answering. i tried using the apache-commons fileupload but
couldnt make that work. so i decided to implement it on my own. DO you
have any sample code which works?

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



Servlet for uploading file

2009-07-17 Thread Petein

Hi. I have this servlet for file uploading.

import java.io.DataInputStream;

import java.io.File;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.IOException;

import java.io.PrintWriter;



import javax.servlet.ServletConfig;

import javax.servlet.ServletException;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;



@SuppressWarnings("serial")

public class myUploadServlet extends HttpServlet {



public void init(ServletConfig config) throws ServletException {

super.init(config);

}



public void doGet(HttpServletRequest request, HttpServletResponse
response)

throws ServletException {



}



public void doPost(HttpServletRequest request, HttpServletResponse
response)

throws ServletException {



String contentType = request.getContentType();



if ((contentType != null)

&& (contentType.indexOf("multipart/form-data") 
>= 0)) {

DataInputStream in;

byte dataBytes[];

try {

in = new 
DataInputStream(request.getInputStream());



// we are taking the length of Content type data

int formDataLength = request.getContentLength();

dataBytes = new byte[formDataLength];

int byteRead = 0;

int totalBytesRead = 0;

// this loop converting the uploaded file into 
byte code

while (totalBytesRead < formDataLength) {

byteRead = in.read(dataBytes, 
totalBytesRead,

formDataLength);

totalBytesRead += byteRead;

}



} catch (IOException e) {

e.printStackTrace();

return;

}



String file = new String(dataBytes);

// for saving the file name

String saveFile = 
file.substring(file.indexOf("filename=\"") + 10);

saveFile = saveFile.substring(0, 
saveFile.indexOf("\n"));

saveFile = 
saveFile.substring(saveFile.lastIndexOf("\\") + 1,

saveFile.indexOf("\""));



//System.out.println("saveFile = " + saveFile);

int lastIndex = contentType.lastIndexOf("=");

String boundary = contentType.substring(lastIndex + 1, 
contentType

.length());

int pos;

// extracting the index of file

pos = file.indexOf("filename=\"");

pos = file.indexOf("\n", pos) + 1;

pos = file.indexOf("\n", pos) + 1;

pos = file.indexOf("\n", pos) + 1;

int boundaryLocation = file.indexOf(boundary, pos) - 4;

int startPos = ((file.substring(0, 
pos)).getBytes()).length;

int endPos = ((file.substring(0, 
boundaryLocation)).getBytes
()).length;



// creating a new file with the same name and writing 
the content
in

// new file



FileOutputStream fileOut;

PrintWriter out = null;

try {

out = response.getWriter();

} catch (IOException e2) {

// TODO Auto-generated catch block

e2.printStackTrace();

}



String path = "Images" + File.separator + saveFile;

try {

fileOut = new FileOutputStream(path);



fileOut.write(dataBytes, startPos, (endPos - 
startPos));

fileOut.flush();

fileOut.close();

} catch (FileNotFoundException e) {

response.setContentType("text/html");


response.setContentLength(e.getMessage().length());

out.println( /* e.getMessage() */"File Not 
Found");

// e.printStackTrace();

return;

} catch (IOException e) {

  

Re: GWT + system call

2009-07-11 Thread Petein

if I deploy my gwt web app to jetty i wont be able to perform the
system call?

On 11 Ιούλ, 17:32, DuoCentillion  wrote:
> Ive had issues with this.  GWTHosted mode is nice enough to let you
> do whateversystemcalls you want from my experience.  The problem is
> deployment.  I realised after I had a fully functioning ap that most
> of the standard servlet containers are not all that flexible if you
> want to dosystemcalls.  For me this has meant that my aps have sit
> in hosted mode.  The best solution I have come up is to write my own
> socket client/server - so that the sock server runs as a separate
> process from the servlet container and can make arbitrarysystem
> calls.
>
> This is ugly and a giant pain in the arse, but it is the best I have
> come up with thus far.
>
> On Jul 11, 1:25 pm, Petein  wrote:
>
>
>
> > I've read that you can't perform aSystemCallfrom a servlet
> > container. No matter what though i must perform asystemcallto
> > octave and i must find a way to do that. Do you have any ideas? Please
> > give me some ideas because i'm completely stuck. How can I make a
> > servlet actually let me perform aSystemCallor better viaGWTRPC.
--~--~-~--~~~---~--~~
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: include html from a gwt web app

2009-07-11 Thread Petein

Thanks!

On 11 Ιούλ, 11:47, Ian Bambury  wrote:
> 2009/7/11 Petein 
>
>
>
>
>
>
>
> > > Apart from the Frame widget, there is nothing which just loads a remote
> > > server page.
>
> > Although i set the Frame size it doesnt keep the size and i can't view
> > what i want properly. It just shows the web page in a small frame.
> > Anyway if there is no other way i will create new HTML objects and
> > create the html like that (Hyperlinks , etc). Any other ideas?
>
> > > > "Don't include the hostname then. Just get something like '/
> > > > mypage.html'. "
>
> > > > How can i get this
>
> > > Make an Ajax call.
>
> > How can i make an ajax call? I've searched Google but didn't find
> > anything helpful :(
>
> RPC or RequestBuilder
>
> Ian
>
> http://examples.roughian.com
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



GWT + system call

2009-07-11 Thread Petein

I've read that you can't perform a System Call from a servlet
container. No matter what though i must perform a system call to
octave and i must find a way to do that. Do you have any ideas? Please
give me some ideas because i'm completely stuck. How can I make a
servlet actually let me perform a System Call or better via GWT RPC.
--~--~-~--~~~---~--~~
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: include html from a gwt web app

2009-07-11 Thread Petein


> Apart from the Frame widget, there is nothing which just loads a remote
> server page.

Although i set the Frame size it doesnt keep the size and i can't view
what i want properly. It just shows the web page in a small frame.
Anyway if there is no other way i will create new HTML objects and
create the html like that (Hyperlinks , etc). Any other ideas?
>
>
>
> > "Don't include the hostname then. Just get something like '/
> > mypage.html'. "
>
> > How can i get this
>
> Make an Ajax call.

How can i make an ajax call? I've searched Google but didn't find
anything helpful :(
--~--~-~--~~~---~--~~
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: include html from a gwt web app

2009-07-10 Thread Petein

Yes but this doesnt do the include. Which widget/class should i use to
load a specific html page?

"Don't include the hostname then. Just get something like '/
mypage.html'. "

How can i get 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
-~--~~~~--~~--~--~---



Download pdf from gwt web app

2009-07-10 Thread Petein

Window.open("localhost:8080/Files/", "Thesis.pdf", "");
localhost:8080/Files/ and then Thesis.pdf open in my web browser
1. why the Window.open command doesnt open it
 2. how can i just say to the browser that the pdf file is in the
Files dir and dont declare the host as well?

I know that gwt is js and executes on the client but i didnt find
anything for downloading files.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Download pdf from gwt web app

2009-07-10 Thread Petein

Window.open("localhost:8080/Files/", "Thesis.pdf", "");
localhost:8080/Files/ and then Thesis.pdf open in my web browser
1. why the Window.open command doesnt open it
 2. how can i just say to the browser that the pdf file is in the
Files dir and dont declare the host as well?

I know that gwt is js and executes on the client but i didnt find
anything for downloading files.
--~--~-~--~~~---~--~~
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: include html from a gwt web app

2009-07-10 Thread Petein

how can i fetch the html page from the page when i dont know which
will be the final host ?(at the moment its localhost ...)

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



include html from a gwt web app

2009-07-10 Thread Petein

When programming in jsp you can use the jsp:include when you want to
include an html file in that part where the tag is. Can i do something
similar in my gwt web app?

Like when i press a button to do

rp = RootPanel.get("mainContainer");
rp.clear();
//here do the include


This will help me separate html from my gwt web application and when
pressing several buttons to load the specific context. Any ideas?
--~--~-~--~~~---~--~~
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: GWT upload file

2009-06-23 Thread Petein

And how can i handle exceptions when an exception is thrown from my
servlet?

On 22 Ιούν, 23:55, waf  wrote:
> Petein,
>
> Try to change form.add(vPanel);  with vPanel.add(form);
> maybe that helps a little.
>
> --
> waf
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



GWT upload file handle exception

2009-06-23 Thread Petein

hi I have a form which sends a request to a servlet for uploading a
file. How can i handle the exceptions? THe exceptions are caught in
the doPost method of the servlet. The form in my app looks like:

form = new FormPanel();
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);

form.setAction("/myfacerecognitionwa/upload");

form.addSubmitHandler(new SubmitHandler(){

@Override
public void onSubmit(SubmitEvent event) {

try{

}catch(Exception e){
Window.alert("Error: " + 
e.getMessage());
return;
}

Window.alert("The file was uploaded!");

}


});

vPanel = new VerticalPanel();

upload = new FileUpload();
upload.setName("upload");
vPanel.add(upload);

vPanel.add(new Button("Submit", new ClickHandler()
{

public void onClick(ClickEvent event) {

form.submit();

}
}));

form.add(vPanel);

What can I do? I want to catch the exceptions and show them using
Window.alert("Error: " + ioe.getMessage());
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



GWT upload file

2009-06-22 Thread Petein

hi i created a second form which will let be choose a file and then
there is a button for uploading the file which communicates with a
servlet for the upload. Here are the 2 sources:

Why the file doesnt upload? Any ideas? Anyone to give me a working
example?

package faceRecognition.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FileUpload;
import com.google.gwt.user.client.ui.FormHandler;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.FormSubmitCompleteEvent;
import com.google.gwt.user.client.ui.FormSubmitEvent;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;

@SuppressWarnings("deprecation")
public class FormUpload extends Composite{

final FormPanel form;
final VerticalPanel vPanel;
final FileUpload upload;

public FormUpload(String user) {

form = new FormPanel();
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
form.addStyleName("table-center");
form.addStyleName("demo-panel-padded");
form.setWidth("275px");

vPanel = new VerticalPanel();

upload = new FileUpload();
upload.setName("upload");
vPanel.add(upload);

vPanel.add(new HTML(""));

vPanel.add(new Button("Submit", new ClickHandler()
{

@Override
public void onClick(ClickEvent event) {
//form submit
}
}));

form.add(vPanel);

initWidget(vPanel);

form.setAction("/myfacerecognitionwa/upload");

form.addFormHandler(new FormHandler()
{
public void onSubmit(final FormSubmitEvent event)
{
Window.alert(event.toString());
}

public void onSubmitComplete(final 
FormSubmitCompleteEvent event)
{
Window.alert(event.getResults());
}
});



}

}



/*


SERVLET CODE


*/

package faceRecognition.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FileUpload;
import com.google.gwt.user.client.ui.FormHandler;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.FormSubmitCompleteEvent;
import com.google.gwt.user.client.ui.FormSubmitEvent;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;

@SuppressWarnings("deprecation")
public class FormUpload extends Composite{

final FormPanel form;
final VerticalPanel vPanel;
final FileUpload upload;

public FormUpload(String user) {

form = new FormPanel();
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
form.addStyleName("table-center");
form.addStyleName("demo-panel-padded");
form.setWidth("275px");

vPanel = new VerticalPanel();

upload = new FileUpload();
upload.setName("upload");
vPanel.add(upload);

vPanel.add(new HTML(""));

vPanel.add(new Button("Submit", new ClickHandler()
{

@Override
public void onClick(ClickEvent event) {
//form submit
}
}));

form.add(vPanel);

initWidget(vPanel);

form.setAction("/myfacerecognitionwa/upload");

form.addFormHandler(new FormHandler()
{
public void onSubmit(final FormSubmitEvent event)
{
Window.alert(event.toString());
}

public void onSubmitComplete(final 
FormSubmitCompleteEvent event)
{
Window.alert(event.getResults());
}
});



}

}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 

GWT upload file

2009-06-22 Thread Petein

hi i created a second form which will let be choose a file and then
there is a button for uploading the file which communicates with a
servlet for the upload. Here are the 2 sources:

Why the file doesnt upload? Any ideas? Anyone to give me a working
example?

package faceRecognition.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FileUpload;
import com.google.gwt.user.client.ui.FormHandler;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.FormSubmitCompleteEvent;
import com.google.gwt.user.client.ui.FormSubmitEvent;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;

@SuppressWarnings("deprecation")
public class FormUpload extends Composite{

final FormPanel form;
final VerticalPanel vPanel;
final FileUpload upload;

public FormUpload(String user) {

form = new FormPanel();
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
form.addStyleName("table-center");
form.addStyleName("demo-panel-padded");
form.setWidth("275px");

vPanel = new VerticalPanel();

upload = new FileUpload();
upload.setName("upload");
vPanel.add(upload);

vPanel.add(new HTML(""));

vPanel.add(new Button("Submit", new ClickHandler()
{

@Override
public void onClick(ClickEvent event) {
//form submit
}
}));

form.add(vPanel);

initWidget(vPanel);

form.setAction("/myfacerecognitionwa/upload");

form.addFormHandler(new FormHandler()
{
public void onSubmit(final FormSubmitEvent event)
{
Window.alert(event.toString());
}

public void onSubmitComplete(final 
FormSubmitCompleteEvent event)
{
Window.alert(event.getResults());
}
});



}

}



/*


SERVLET CODE


*/

package faceRecognition.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FileUpload;
import com.google.gwt.user.client.ui.FormHandler;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.FormSubmitCompleteEvent;
import com.google.gwt.user.client.ui.FormSubmitEvent;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;

@SuppressWarnings("deprecation")
public class FormUpload extends Composite{

final FormPanel form;
final VerticalPanel vPanel;
final FileUpload upload;

public FormUpload(String user) {

form = new FormPanel();
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
form.addStyleName("table-center");
form.addStyleName("demo-panel-padded");
form.setWidth("275px");

vPanel = new VerticalPanel();

upload = new FileUpload();
upload.setName("upload");
vPanel.add(upload);

vPanel.add(new HTML(""));

vPanel.add(new Button("Submit", new ClickHandler()
{

@Override
public void onClick(ClickEvent event) {
//form submit
}
}));

form.add(vPanel);

initWidget(vPanel);

form.setAction("/myfacerecognitionwa/upload");

form.addFormHandler(new FormHandler()
{
public void onSubmit(final FormSubmitEvent event)
{
Window.alert(event.toString());
}

public void onSubmitComplete(final 
FormSubmitCompleteEvent event)
{
Window.alert(event.getResults());
}
});



}

}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 

Re: gwt and jdbc

2009-06-20 Thread Petein

problem solved! Thanks!

On Jun 20, 1:00 pm, Enea  wrote:
> hm... I had similar problem with jdbc...
>
> if you are using eclipse,
> try to go under Project->properties->google->App Engine
> and disable "Use Google App Engine" checkbox .
>
> regards :)
>
> On 20 Giu, 02:00, Petein  wrote:
>
>
>
> > package faceRecognition.server;
>
> > import faceRecognition.client.AuthService;
> > import com.google.gwt.user.server.rpc.RemoteServiceServlet;
>
> > import java.sql.*;
> > import java.util.*;
> > import java.text.SimpleDateFormat;
>
> > /**
> >  * The server side implementation of the RPC service.
> >  */
> > @SuppressWarnings("serial")
> > public class AuthServiceImpl extends RemoteServiceServlet implements
> >                 AuthService {
>
> >         public String doAuthenticate(String name, String surname,
> >                         String username, String password,
> >                         String email, String info){
>
> >                 String serverInfo = getServletContext().getServerInfo();
> >                 String userAgent = 
> > getThreadLocalRequest().getHeader("User-Agent");
>
> >                 //jdbc part
>
> >                 /*
> >                 Connection con = null;
> >         try {
>
> >           Class.forName("com.mysql.jdbc.Driver").newInstance();
>
> >             //out.println("driver is ok");
>
> >             String url = "jdbc:mysql://" + "localhost" + "/" +
> > "USERSDB" + "?";
> >             String usernamedb = "root";
> >             String passworddb = "";
> >             con = (Connection) DriverManager.getConnection(url,
> > usernamedb, passworddb);
>
> >             Statement st = con.createStatement();
> >             ResultSet rs;
>
> >            rs = st.executeQuery("SELECT username, password FROM
> > users");
>
> >             boolean found = false;
>
> >             while (rs.next()) {
> >                 usernamedb = rs.getString(1);
> >                 passworddb = rs.getString(2);
>
> >                 if (usernamedb.equals(username)) {
> >                     found = true;
> >                     break;
> >                 }
> >             }
>
> >             if (!found){
>
> >                         password = " a";
> >                 //create user
>
> >                 String sql = "INSERT INTO testusers(name, username,
> > password, info) VALUES(?, ?, ?, ?)";
>
> >                 PreparedStatement pstmt = con.prepareStatement(sql);
>
> >                 // Set the values
> >                 pstmt.setString(1, name);
> >                 pstmt.setString(2, username);
> >                 pstmt.setString(3, password);
> >                 pstmt.setString(4, info);
>
> >                 //Calendar calendar = new GregorianCalendar(); String
> > time = calendar.getTime().toString();  //Thu Jun 11 02:30:10 EEST 2009
>
> >                 //String time = new GregorianCalendar().getTime
> > ().toString();
>
> >                 //pstmt.setString(5, time);
>
> >                 pstmt.execute();
>
> >             }
>
> >         }catch(ClassNotFoundException cnfe){
> >                 return(cnfe.toString());
> >         } catch(SQLException sqle){
> >                 return(sqle.toString());
> >         } catch(InstantiationException ie){
> >                 return(ie.toString());
> >         }catch (IllegalAccessException iae) {
> >                         return(iae.toString());
> >                 }
>
> >             */
>
> >                 return "Hello, " + name +  " " + surname + "!Server 
> > info: "
> > + serverInfo
> >                                 + ".Using:" + userAgent + " 
> > Your request was sent!";
> >         }
>
> > }
>
> > when this part of code is executed without the jdbc part it executes
> > fine and the RPC method works ok.
> > When i execute the code as it is above i get these errors:
> > The server is running athttp://localhost:1598/
> > 19 Ιουν 2009 11:33:32 μμ
> > com.google.appengine.tools.development.ApiProxyLocalImpl log
> > SEVERE: [1245454412421000] javax.servlet.ServletContext log: Exception
> > while dispatching incoming RPC call
> > com.google.gwt.user.server.rpc

gwt and jdbc

2009-06-19 Thread Petein

package faceRecognition.server;

import faceRecognition.client.AuthService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

import java.sql.*;
import java.util.*;
import java.text.SimpleDateFormat;

/**
 * The server side implementation of the RPC service.
 */
@SuppressWarnings("serial")
public class AuthServiceImpl extends RemoteServiceServlet implements
AuthService {

public String doAuthenticate(String name, String surname,
String username, String password,
String email, String info){

String serverInfo = getServletContext().getServerInfo();
String userAgent = 
getThreadLocalRequest().getHeader("User-Agent");

//jdbc part

/*
Connection con = null;
try {

  Class.forName("com.mysql.jdbc.Driver").newInstance();

//out.println("driver is ok");

String url = "jdbc:mysql://" + "localhost" + "/" +
"USERSDB" + "?";
String usernamedb = "root";
String passworddb = "";
con = (Connection) DriverManager.getConnection(url,
usernamedb, passworddb);

Statement st = con.createStatement();
ResultSet rs;

   rs = st.executeQuery("SELECT username, password FROM
users");

boolean found = false;

while (rs.next()) {
usernamedb = rs.getString(1);
passworddb = rs.getString(2);

if (usernamedb.equals(username)) {
found = true;
break;
}
}

if (!found){

password = " a";
//create user

String sql = "INSERT INTO testusers(name, username,
password, info) VALUES(?, ?, ?, ?)";


PreparedStatement pstmt = con.prepareStatement(sql);

// Set the values
pstmt.setString(1, name);
pstmt.setString(2, username);
pstmt.setString(3, password);
pstmt.setString(4, info);


//Calendar calendar = new GregorianCalendar(); String
time = calendar.getTime().toString();  //Thu Jun 11 02:30:10 EEST 2009

//String time = new GregorianCalendar().getTime
().toString();

//pstmt.setString(5, time);


pstmt.execute();

}



}catch(ClassNotFoundException cnfe){
return(cnfe.toString());
} catch(SQLException sqle){
return(sqle.toString());
} catch(InstantiationException ie){
return(ie.toString());
}catch (IllegalAccessException iae) {
return(iae.toString());
}

*/

return "Hello, " + name +  " " + surname + "!Server 
info: "
+ serverInfo
+ ".Using:" + userAgent + " Your 
request was sent!";
}
}


when this part of code is executed without the jdbc part it executes
fine and the RPC method works ok.
When i execute the code as it is above i get these errors:
The server is running at http://localhost:1598/
19 Ιουν 2009 11:33:32 μμ
com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: [1245454412421000] javax.servlet.ServletContext log: Exception
while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract java.lang.String
faceRecognition.client.AuthService.doAuthenticate
(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)'
threw an unexpected exception: java.lang.ExceptionInInitializerError
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)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1093)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle
(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle
(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle
(Context

Configure Eclipse to Deploy my gwt web app to Tomcat 6.0

2009-06-17 Thread Petein

How can i deploy my gwt web app to Tomcat 6.0? My wep app works fine
on hosted mode and although I've set the web application i couldn;t
make it execute. Any ideas?

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