Losing some characters via POST requests

2009-06-25 Thread Morpheu5

Hello everybody. I couldn't find any answer, mostly because I'm quite
new to GWT and I couldn't isolate the problem.
Anyway, here's what happens. I send a POST request with data gathered
from various from components, such as text areas, text lines and so on
and so forth. Then I process the request with a PHP backend that
simply saves those fields in an appropriate file, and when I look into
that file, some characters are missing, and some of them even truncate
some fields. I found that some characters pose the problem, some
others don't. Some of those that pose the problem are ° and #, some of
those that are correctly handled are ç and à.
I also tried to debug this by making the backend output all the fields
and then displaying it with a GWT dialog but the result is unchanged.
Apparently the bad things happen between the POST request and the PHP
interpreter.
I do urlencode everything I send out, and the backend can be made as
simple as a print_r($_POST), and still exhibit the misbehaviour.

Any clue?

--~--~-~--~~~---~--~~
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: Losing some characters via POST requests

2009-06-26 Thread Morpheu5

Hi, thanks for the replies.
The code is as simple as you can imagine: urlencoding and post request
on the client side (as copypasted from examples I found on the
Internet and slightly modified to suit my needs), $_POST dumping on
the server side.
Anyway, the problem was apparently only appearing with contents from
TinyMCE editor, not from other fields, and this is a thing I didn't
really notice before. Thanks to Ian, I switched to encodeComponent()
and everything seems to work now. By the way, what's the difference
between encode() and encodeComponent()?

--
Andrea
--~--~-~--~~~---~--~~
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: Will Google Plugin for Eclipse lineup with Eclipse Galileo Release ?

2009-06-26 Thread Morpheu5

I'd need to reinstall Eclipse due to PDT misbehaviour and I'd love to
go for Galileo, so count me in :)

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



Best practices with typical LAMP backend and GWT frontend

2009-06-26 Thread Morpheu5

Hello everybody,
I already started coding some small applications using backends on
LAMP and creating the frontend UI with GWT, I already know how to
overcome the same origin issue while testing locally, and of course I
have some working knowledge of Java, but now I need some advices about
some unclear points -- or maybe they're clear and I am blind :)

1. Deployment
Suppose I have my backend application -- e.g. a web site rendering
engine, not exactly what you'd call a backend but we'll make it work
for this example by supposing it also has an engine to take data from
a client application and store them in a database that will be used
for rendering -- residing at localhost/mywebsite/. Now, suppose I want
to write the administration panel, so I set up a GWT project called
mywebsiteAdmin with the appropriate assumptions and configurations,
and start coding. Everything works, I'm ready to compile the project
and deploy it to my remote webserver. Now suppose that I already have
the backend installed at www.mywebsite.com and I want the admin
interface to be available at www.mywebsite.com/admin/. First of all, I
take all the relevant files from mywebsiteAdmin/war/ and put them into
localhost/mywebsite/admin/. Then I upload this directory to my remote
server and launch it. Oops, I hardcoded the url to which to make
remote requests, which is localhost/mywebsite/remotelistener.php.
Let's go and change it, but how? If I locally run the application from
the project's url, I get something like 
http://localhost/mywebsiteAdmin/war/MywebsiteAdmin.html,
but if I try to locally run it from the backend's url I get something
like http://localhost/mywebsite/admin/MywebsiteAdmin.html (which is
also quite ugly, but of course I can rename that file to index.html
and ignore it) and finally when I go remote, I get
www.mywebsite.com/admin/MywebsiteAdmin.html (of course I can still
rename it to index.html) and here comes the point. My remote listener
is both at localhost/mywebsite/remotelistener.php and at
www.mywebsite/remotelistener.php and my admin application can be at a
large variety of different urls.
Solution: have the location to be discovered automatically by the GWT
frontend. Wait. I hope you see the difficulty by yourselves, because
I've already seen it for an entire day now trying to make some regexp/
conditions to do the job. No success.
Solution 2: have a config file that tells me where the remote listener
is. No, wait. How can I retrieve a remote file if I can't make
requests? Beside this, I'd rather not have my users have to edit two
separate files, because the only way I see this working (not too
hopeful, though) is having the file put together with the admin
application. Of course I can have these two files created via some
sort of install procedure, but I'd rather keep this as a last resort.

Other 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: Best practices with typical LAMP backend and GWT frontend

2009-06-28 Thread Morpheu5

Hello everybody,
I already started coding some small applications using backends on
LAMP and creating the frontend UI with GWT, I already know how to
overcome the same origin issue while testing locally, and of course I
have some working knowledge of Java, but now I need some advices about
some unclear points -- or maybe they're clear and I am blind :)

Suppose I have my backend application -- e.g. a web site rendering
engine, not exactly what you'd call a backend but we'll make it work
for this example by supposing it also has an engine to take data from
a client application and store them in a database that will be used
for rendering -- residing at localhost/mywebsite/. Now, suppose I want
to write the administration panel, so I set up a GWT project called
mywebsiteAdmin with the appropriate assumptions and configurations,
and start coding. Everything works, I'm ready to compile the project
and deploy it to my remote webserver. Now suppose that I already have
the backend installed atwww.mywebsite.comand I want the admin
interface to be available atwww.mywebsite.com/admin/. First of all, I
take all the relevant files from mywebsiteAdmin/war/ and put them into
localhost/mywebsite/admin/. Then I upload this directory to my remote
server and launch it. Oops, I hardcoded the url to which to make
remote requests, which is localhost/mywebsite/remotelistener.php.
Let's go and change it, but how? If I locally run the application from
the project's url, I get something 
likehttp://localhost/mywebsiteAdmin/war/MywebsiteAdmin.html,
but if I try to locally run it from the backend's url I get something
likehttp://localhost/mywebsite/admin/MywebsiteAdmin.html(which is
also quite ugly, but of course I can rename that file to index.html
and ignore it) and finally when I go remote, I getwww.mywebsite.com/
admin/MywebsiteAdmin.html(of course I can still
rename it to index.html) and here comes the point. My remote listener
is both at localhost/mywebsite/remotelistener.php and atwww.mywebsite/
remotelistener.phpand my admin application can be at a
large variety of different urls.
Solution: have the location to be discovered automatically by the GWT
frontend. Wait. I hope you see the difficulty by yourselves, because
I've already seen it for an entire day now trying to make some regexp/
conditions to do the job. No success.
Solution 2: have a config file that tells me where the remote listener
is. No, wait. How can I retrieve a remote file if I can't make
requests? Beside this, I'd rather not have my users have to edit two
separate files, because the only way I see this working (not too
hopeful, though) is having the file put together with the admin
application. Of course I can have these two files created via some
sort of install procedure, but I'd rather keep this as a last resort.

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