From: Rousseau, J. R. <JRR...@Ba...> - 2004-12-10 19:48:20
|
everything works perfectly fine with a regular browser. Actually this application is in production in several of our customers. It works fine also with JWebUnit(HttpUnit). One of the difference between the working pages and the non-working pages is that the non-working pages go through a ServletFilter before being produced. In Both cases, a Servlet handles the request, produced XML that is then transformed by an XSL stylesheet. I'll re-try with the proposed loggers thanks, Jean-Rene > -----Original Message----- > From: Marc Guillemot [mailto:mgu...@ya...] > Sent: Friday, December 10, 2004 2:42 PM > To: htm...@li... > Subject: Re: [Htmlunit-user] Re: Problems handling with the > Content-Type > is specified using ME TA tags? > > > Jean Rene, > > you can set log level to debug for > > logger.httpclient.wire > httpclient.wire.header > httpclient.wire.content > > and you will really get more information. > > Are some of the pages you have problem with available on the internet? > > Marc. > > Rousseau, Jean Rene wrote: > > I'm so confused with this problem... > > > > Here are my logs when it works > > > > Content type is: text/html > > Content stream is: > > <html > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > xmlns:java="java"> > > <head> > > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > > (...) > > > > Here is when it doesn't work: > > > > Content type is: > > Content Stream is: > > <html > xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslatorUtil" > > xmlns:java="java"> > > <head> > > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > > (...) > > > > We clearly see that webResponde.getContentType() returns > null !! but why > > !?!?!? response content stream is the same as the correct output. > > > > So how is it possible that my content-type is null in > certain pages ? > > > > > >>-----Original Message----- > >>From: David D.Kilzer [mailto:ddk...@ki...] > >>Sent: Friday, December 10, 2004 11:40 AM > >>To: htm...@li... > >>Subject: Re: [Htmlunit-user] Re: Problems handling with the > >>Content-Type > >>i s specified using ME TA tags? > >> > >> > >>What "Content-Type:" header is your web server sending back > for this > >>page? (If you're using Mozilla or Firefox, you can do a > "Get Info" > >>once the page is loaded to find out, or use a packet sniffer like > >>Ethereal to capture the headers "on the wire".) > >> > >>In htmlunit-1.3, the DefaultPageCreator.createPage() method > is where > >>the decision is made on what type of page to create. > >>Apparently, this > >>page is causing all of the if/else logic to fall through to > >>create an > >>UnexpectedPage object. > >> > >>Dave > >> > >> > >>On Dec 10, 2004, at 9:16 AM, Rousseau, Jean Rene wrote: > >> > >> > >>>Hi, > >>> > >>>Here is more info about my problem. I'm really confused, > >> > >>because I have > >> > >>>similar headers in other pages and they work ok !!. > >>> > >>>Any ideas ? > >>> > >>> > >>>code: > >>> > >>> URL url = new > >> > >>URL(state.getBaseUrl()+"/html/admin/home_en.html"); > >> > >>> HtmlPage page = null; > >>> page = (HtmlPage)state.getWebClient().getPage(url); > >>> HtmlForm form = page.getFormByName("login"); > >>> > >>> > >> > >>form.getInputByName("userid").setValueAttribute(cells.more.tex > >>t().toUpp > >> > >>>erCase()); > >>> > >>> > >> > >>form.getInputByName("password").setValueAttribute(cells.more.m > > > > ore.text( > > > >>>).toUpperCase()); > >>> > >>> Page p = form.submit(); > >>> System.out.println(p); > >>> System.out.println(p.getWebResponse().getContentAsString()); > >>> state.setCurrentPage((HtmlPage)form.submit()); > >>> > >>>This gives me a ClassCastException because the response page is an > >>>UnexcpectedPage. > >>> > >>>output: > >>> > >>>com.gargoylesoftware.htmlunit.UnexpectedPage@302e67 > >>> > >>><html > >>> > >> > >>xmlns:translator="com.banctec.pca.pub.PublicLanguageTranslat > orUtil" > >> > >>>xmlns:java="java"> > >>><head> > >>><META http-equiv="Content-Type" content="text/html; > >>>charset=ISO-8859-1"> > >>><link href="/pca/stylesheets/pcaadmin.css" type="text/css" > >>>rel="stylesheet"> > >>><title>PCA Admin: Users List</title> > >>></head> > >>>(...) > >> > >> > >> > >>------------------------------------------------------- > >>SF email is sponsored by - The IT Product Guide > >>Read honest & candid reviews on hundreds of IT Products from > >>real users. > >>Discover which products truly live up to the hype. Start > reading now. > >>http://productguide.itmanagersjournal.com/ > >>_______________________________________________ > >>Htmlunit-user mailing list > >>Htm...@li... > >>https://lists.sourceforge.net/lists/listinfo/htmlunit-user > >> > > > > > > > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT Products > from real users. > > Discover which products truly live up to the hype. Start > reading now. > > http://productguide.itmanagersjournal.com/ > > _______________________________________________ > > Htmlunit-user mailing list > > Htm...@li... > > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from > real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > |