From: Marc G. <mgu...@ya...> - 2005-05-30 08:13:08
|
Hi, in the first case, I can imagine that the url is not correctly resolved (what would explain the long time before the exeception). I can't say more without stacktrace and example of the failing code. In the second case, it looks like a classpath issue. Are your sure to use the lib provided with htmlunit and only these libs? Marc. SALL Ousmane wrote: > Hi there > Currently i'am working with html unit on local page in > order to handle javascript redirection. > It's seems to work well, but i have 2 cases that > generate exception: > I load my local page like this: > ----------------- > WebClient client = new > WebClient(BrowserVersion.MOZILLA_1_0); > MockWebConnection cnx = new MockWebConnection(client); > > cnx.setDefaultResponse(st); > client.setWebConnection(cnx); > > HtmlPage page = (HtmlPage) client.getPage(new > URL(url)); > ----------------- > > > And when i have some direct redirection in javascript > source, like: > > ---------------- > <SCRIPT language="javascript"> > window.open('misc/popup/popup_head.htm','','height=360,width=550'); > </SCRIPT> > <HTML> > <HEAD> > ---------------- > > my application generate an exception, after a long > time of exectution > (maybe stackoverflow or time out ?) > > > And when i have some javascript include by javascript, > like: > ---------------- > > <SCRIPT language="JavaScript"> > <!-- > document.write("<script language='JavaScript' > src='lib-load.js'></scr"+"ipt>") > //--> > </SCRIPT> > ---------------- > > the generated exception is: > > java.lang.NoSuchMethodError: > org.apache.commons.httpclient.util.EncodingUtil.getString([BIILjava/lang/StringLjava/lang/String; > at > com.gargoylesoftware.htmlunit.html.HtmlPage.loadJavaScriptFromUrl(HtmlPage.java:842) > > So, maybe it can be possible to pre-parse javascript > code in order to find that > document.write will make a javascript inclusion? > > thank in advance for any help! > > > > > > > _____________________________________________________________________________ > Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, photos et vidéos ! > Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com > > > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |