How can I call an ASP page from JSP?

Josh Lam

I'm not sure if you just want to redirect to an ASP page from a JSP page, in which case, you should use response.sendRedirect() eg


Remember though that this must be executed before any output is sent to the.

Also note that whatever parameters sent to your jsp page will be sent to your asp page.

Once you have redirected to an ASP page, control is now turned over to the ASP page and there is no way to return to your original JSP page.

On the other hand, if you calling an ASP page to retrieve non html outputs (eg xml) so that you can parse it in your JSP page, consider opening a url connection to that ASP page. Retrieve the output back from the asp page and then parse the output for your own purpose.

Look at for an example of the how you would do that except you want to embed the code in a JSP scriptlet and set the url to your asp in the URL object.

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact