File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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:
subject: Reading .asp file from servlet
Similar Threads
Pass HTTPSession to ASP
applet and asp
help needed with jsp:getProperty
Change file name ending for JSP pages
How to submit from ASP to Servlet