wood burning stoves 2.0*
The moose likes Servlets and the fly likes Reading .asp file from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Reading .asp file from servlet" Watch "Reading .asp file from servlet" New topic

Reading .asp file from servlet

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
does any body know how to read .asp file from a servlet by passing user id information to that file.(.asp file has all the user information)
Please give me the code if anybody knows
subbu v

Joined: Oct 17, 2000
Posts: 5
From your servlet code use the url and urlconnection classes , passing the url to the asp page you need to access with the querystring having the userid.. do a read on the url and you will have the entire html output (asp throws back html output after processing the scripts on the server side). Now you can parse the html to have the necessary information in your servlet.. it is very simple and i am sure you should be able to do it.. just remember that i am assuming here that the asp page takes its input (the userid) as a querystring and the html output it throws is of a standard format that is already known to you.. best of luck..
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
thanks for ur help, do u have the code for this byany chance.
(i am unable to post this with my privious name Kavin, that's why i am using other name)
thank u
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I tried your suggestion of using urlConnection, but it complains about "can't find the asp file". I am using IIS with servletExec as plug in. Is there configration that needs to be done?
I agree. Here's the link: http://aspose.com/file-tools
subject: Reading .asp file from servlet
Similar Threads
applet and asp
Pass HTTPSession to ASP
help needed with jsp:getProperty
How to submit from ASP to Servlet
Change file name ending for JSP pages