• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Jakarta HttpClient : JavaScript in Java

 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

I am using Jakarta HttpClient to invoke a jsp(could be html).the page don't have any code except a few javascript code lines.but HttpClient is not calling my javascript code.However other pages,those don't have javascript, are running fine.
Please,if any one have any idea help me.

Thanks,
Vijay Saraf.
 
Sheriff
Posts: 28344
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's true, HttpClient just returns the contents of the page to you. If you want to interpret the HTML in some way then it's up to you to do that.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the JS is not too involved, then using HttpUnit, HtmlUnit or jWebUnit (all can be found on SourceForge) instead of HttpClient might do the trick. Although they are meant for testing web apps, they can be used for the automation of all kinds of web app accesses. Of course, they don't implement all the HTTP features that HttpClient does, so if that's what you need you may be out of luck.
 
vijay saraf
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think,i should go for HttpUnit, HtmlUnit or jWebUnit.
well thanks to both of you for valuable advise.
Thanks,
Vijay Saraf.
 
vijay saraf
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i tried it with HttpUnit,But my script have some ActiveX Objects(Excel),and perhaps HttpUnit doesn't support it.Can you suggest me any other thing.Should i go for Jacob.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the various JUnit extensions are Java-only - they don't support ActiveX objects.

My guess (and it's really just a hunch) is that you may out of luck, because the ActiveX object may only work in a browser, not in a simulating environment on the client. It probably relies on some IE-specific functionality that the hosting environment would need to duplicate.
 
vijay saraf
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my script doesn't do more than opening & saving xls with new file type.
the previous files are .xls files with file type .htm and new saved files are .xls files with file type .xls.
Why i have written a script is just because of huge no of files (approx 350 in one go daily)
if you have any other idea to carry this task in java, please tell me,i will be very thankful to you.
[ December 29, 2006: Message edited by: vijay saraf ]
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This sounds as if it has nothing to do with accessing a web page, but rather renaming local files? And somehow there's a JavaScript script that does this with help of an ActiveX control?
 
vijay saraf
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes Exactly,There is no inter-action with web in script.
The actual task is as :
I have to generate excel sheets with more than tabs dynamically,
But as we can generate jsp as xls with only one tab.
What i am doing to achive this as :
Step one: I am calling my all web pages one by one with HttpUnit and save the contents as .xls(At this point of time xls files are with file format .htm).
Step two : i run the script to change the file format from .htm to .xls.
Step Three: i Merge all the excels in to one by POI.
However i was trying to merge all the excel files just after first step but at that point i was getting exception for Header.
That is the whole story behind sach scripts.
If any one has done this kind of task please help me.
 
vijay saraf
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I have done that,Using jcom.jar & Jcom.dll i can read xls files with any file type,That has solved my problem.
Thanks every one.
[ January 02, 2007: Message edited by: vijay saraf ]
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic