Post Ajax

55 views
Skip to first unread message

benjamin garcia

unread,
Jul 12, 2013, 8:51:16 AM7/12/13
to ju...@googlegroups.com
Hi, 

I have some problem with jzLoad and I see something but I don't no if it's the problem.
I test on my app and on juzu-tutorial-examples-tomcat. 
On Firefox, the two apps send ajax call without parameters.
On Google chrome, tutorial app work correctly, but not my app (same on firefox, parameters are not received.
I search a little and I found a thing on juzu.impl.bridge.spi.web.Handler. On Method handle (line 148) when jzLoad works, bridge.getRequestContext().getParameters() contains parameter and bridge.getRequestContext().req.getParameterNames() is empty.
When they not work it's reverse bridge.getRequestContext().req.getParameterNames() contain parameters and bridge.getRequestContext().getParameters() is empty.

I debug javascript side too and all parameters are sent correctly.

Have you got an idea?

Benjamin

benjamin garcia

unread,
Jul 12, 2013, 12:32:01 PM7/12/13
to ju...@googlegroups.com
Hi, 

I found my problem. Can you see this : https://github.com/juzu/juzu/pull/34?

Julien Viet

unread,
Jul 15, 2013, 8:00:23 AM7/15/13
to ju...@googlegroups.com
can you provide also a test to avoid any future regression ?

--
You received this message because you are subscribed to the Google Groups "Juzu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to juzu+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

benjamin garcia

unread,
Aug 5, 2013, 2:56:13 AM8/5/13
to ju...@googlegroups.com
Hi, 

Ok, this week if I can have a little time for this.

benjamin garcia

unread,
Aug 13, 2013, 11:48:03 AM8/13/13
to ju...@googlegroups.com
Julien, 

I would like to create two test (with both 'application/x-www-form-urlencoded' and 'application/x-www-form-urlencoded; charset : UTF-8') and define content type before send request. 
I see class A on package plugin.ajax but how I define ContentType on test?

Benjamin 

Julien Viet

unread,
Aug 15, 2013, 8:14:58 AM8/15/13
to ju...@googlegroups.com
you should make rather a request bridge test and not an ajax test that uses a simple form that declares a content type.

I think that copying AbstractRequestFormParamDefaultEncoding should work.

benjamin garcia

unread,
Sep 2, 2013, 5:21:02 AM9/2/13
to ju...@googlegroups.com
Hi, 

I try to doing something, but I haven't time to create test. sorry.

benjamin garcia

unread,
Sep 23, 2013, 6:06:57 AM9/23/13
to ju...@googlegroups.com
Hi, 
I work on this request, but How I change form contentType? I tried on generated html with attribute enctype but it doesn't work. 
I think  it's on navigator driver. I'll try with another drone.
Message has been deleted

Julien Viet

unread,
Sep 23, 2013, 8:56:55 AM9/23/13
to ju...@googlegroups.com
one trivial way is to do without selenium by using a java.net.URL and submitting the form:

for example:

String s = "POST / HTTP/1.1\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 43\r\n\r\nfoo=foo_value&bar=bar_value1&bar=bar_value2"

and submit this using a java.net.URL: see here : http://alien.dowling.edu/~vassil/tutorials/javapost.php

that would give us the absolute certainty that it would work.

On Sep 23, 2013, at 2:23 PM, benjamin garcia <benji....@gmail.com> wrote:

I test with other arquillian webdriver but in this mode even if I put enctype='application/x-www-form-urlencoded;charset:UTF-8' driver redifine contenttype like: "application/x-www-form-urlencoded"

benjamin garcia

unread,
Sep 27, 2013, 8:42:06 AM9/27/13
to ju...@googlegroups.com
Hi,

I finished test thank you for your help. 
I use Httpclient from apache. Test class have two method for each case (with or without charset on contentType).
What do you think of pull request?

Julien Viet

unread,
Sep 27, 2013, 11:33:23 AM9/27/13
to ju...@googlegroups.com
Hi Benjamin,

so I guess it makes sense also to rewrite the unit test in Juzu that uses URL in order to leverage the api of apache HttpClient too.

I will review and merge it.

thanks for your work 
Reply all
Reply to author
Forward
0 new messages