Bonjour tout le monde,

Dans le cadre d'un projet, j'utilise la librairie HtmlUnit. Depuis mon application, je remplie un formulaire. Puis je ramène les valeurs de ses champs et je les insère dans un autre formulaire d'un site distant. Ce site contient du javascript.
Mon problème est que les données sont bien transférées vers le site distant mais toujours j'obtiens des erreurs du type javascript.

Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
final WebClient webClient = new WebClient();
 
	    // Get the first page
	    final HtmlPage page1 = webClient.getPage("http://url-site-distant");
 
	    // Get the form that we are dealing with and within that form, 
	    // find the submit button and the field that we want to change.
	   List form0 = page1.getForms();
 
	   Iterator j = form0.iterator();
	   HtmlForm element = (HtmlForm) j.next();
	   while (j.hasNext() && !(element.getId().equals("MiniConnexion")))
	   {
		   element = (HtmlForm) j.next();
	   }
	   final HtmlForm form = (HtmlForm)element;
          final HtmlSubmitInput button = form.getInputByName("mini-submit");
	    final HtmlTextInput login = form.getInputByName("mini-login");
	    final HtmlPasswordInput pass = form.getInputByName("mini-pass");
 
 
 
	    // Change the value of the text field
	    login.setValueAttribute("login");
	    pass.setValueAttribute("mdp");
 
	    // Now submit the form by clicking the button and get back the second page. 
 
	     HtmlPage page2 = button.click();
Les messages d'erreurs sont :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
5 mai 2009 10:08:17 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
ATTENTION: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://url-site-distant/includes/scripts.js', but got 'application/x-javascript'.
5 mai 2009 10:08:17 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
ATTENTION: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://url-site-distant/aj/ZAjax.js', but got 'application/x-javascript'.
5 mai 2009 10:08:18 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
ATTENTION: Obsolete content type encountered: 'text/javascript'.
5 mai 2009 10:08:19 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
ATTENTION: Obsolete content type encountered: 'text/javascript'.
5 mai 2009 10:08:19 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
ATTENTION: Obsolete content type encountered: 'text/javascript'.
5 mai 2009 10:08:19 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
ATTENTION: Obsolete content type encountered: 'text/javascript'.
5 mai 2009 10:08:19 com.gargoylesoftware.htmlunit.javascript.host.Window jsxFunction_execScript
ATTENTION: VBScript not supported in Window.execScript().
5 mai 2009 10:08:20 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
ATTENTION: Obsolete content type encountered: 'text/javascript'.
5 mai 2009 10:08:21 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
ATTENTION: Obsolete content type encountered: 'text/javascript'.
5 mai 2009 10:08:21 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
ATTENTION: CSS error: http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-3352344532890295&dt=1241510898472&output=html&slotname=6401953523&correlator=1241510898472&url=http%3A%2F%2Fwww.aerpark.fr%2Findex.php&frm=0&ga_vid=883517110.1241510900&ga_sid=1241510900&ga_hid=2052031951&flash=0&w=200&h=200&u_h=768&u_w=1024&u_ah=768&u_aw=1024&u_cd=24&u_tz=120&dtd=M&w=200&h=200&xpc=F73lq1UvBN&p=http%3A//www.aerpark.fr [1:2165] Error in style rule. Invalid token ":". Was expecting one of: <S>, "}", <COMMA>, ";", "/", <PLUS>, "-", <HASH>, <STRING>, <URI>, "!", "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>.
5 mai 2009 10:08:21 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning
ATTENTION: CSS warning: http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-3352344532890295&dt=1241510898472&output=html&slotname=6401953523&correlator=1241510898472&url=http%3A%2F%2Fwww.aerpark.fr%2Findex.php&frm=0&ga_vid=883517110.1241510900&ga_sid=1241510900&ga_hid=2052031951&flash=0&w=200&h=200&u_h=768&u_w=1024&u_ah=768&u_aw=1024&u_cd=24&u_tz=120&dtd=M&w=200&h=200&xpc=F73lq1UvBN&p=http%3A//www.aerpark.fr [1:2165] Ignoring the following declarations in this rule.
5 mai 2009 10:08:21 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
ATTENTION: Obsolete content type encountered: 'text/javascript'.
5 mai 2009 10:08:22 com.gargoylesoftware.htmlunit.javascript.host.Window jsxFunction_execScript
ATTENTION: VBScript not supported in Window.execScript().
Y-a-t-il quelqu'un qui a une idée?
Merci d'avance.