• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URL getInputstream() & Javascript Issues

 
Shawn Franks
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I have been having a very difficult time reading the input-stream of a form submitted Via Java URL connection, it appears that there is a JavaScript file on the site that looks for some specific object to fill in the results of the form into a div after it is submitted. The form works fine via html and via xmlhttprequest, Also i have tried a ajax engine for java and preformed an xmlhttprequest via java and still have the same issue of that object the javascript is looking preventing the Java input stream to return the desired form results. So basically what I am looking for is, is there a way to access a website via java but prevent javascript from running? Since javascript is client and not server side i would think there would be an option in java to disable javascript.
 
Gokul Nanthakumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Script is purely a client side language, when you access some website via java URL connection, you should not get any problem because of javascript, please post the error you are getting
 
Shawn Franks
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gokul Nanthakumar wrote:Java Script is purely a client side language, when you access some website via java URL connection, you should not get any problem because of javascript, please post the error you are getting


I cannot post the error because of it being work related but basically here is how this site works.

on the clients web browser you submit the form via xmlhttprequest. The result is returned and parsed via a specialized javascript engine and then inserted into a DIV via innerHTML.

Now when Submitting this form via Java the DIV doesn't exist and the JavaScript engine replaces the source code with the error message stating the DIV cannot be found. I know it is the Javascript causing the issue, because if i submit the form it fake data it knows that there is no div to fill the requested data into and lets the source stay as it should.
 
Shawn Franks
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any Ideas?
 
Gokul Nanthakumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shawn Franks wrote:
on the clients web browser you submit the form via xmlhttprequest. The result is returned and parsed via a specialized javascript engine and then inserted into a DIV via innerHTML.


if you are submitting the form via xmlhttprequest, then thel logic to inserting the result into DIV must be in a javascript function outside the response of the request.

so the response must not contain javascript code to insert into DIV.

anyway with out code and error message, giving solution with 100% assumption will not work.

if you still feel that the response has the javascript code, then remove convert the response to string and remove the <Script>.....</script> portion, it may help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic