Hello , I have the foolowing problem: I have developed an applet that communicates with a servlet. The applet sends some objects to the servlet. After doing some processing I want to redirect to some other site from within my servlet. I tried the following methods. 1. HttpResponse.sendRedirect(URL); 2. construct the printWriter PrintWriter out= HttpResponse.getWriter(); and then construct an HTML response as out.println("<html><head>....<body> ...</html>"); Unfortunately, none of these methods work . I am not getting any compilation errors. also note that the above two methods work if the user interface is a form and fails if the front end is an applet. Please suggest an alternative. Thanks in Advance Vrinda
What servlet Container(java Based Web server) Do you use? If you use Jakarta -tomcat, the response.sendRedirect(URL) works prety well! The problem is that you can not see out.println("somthing") if you response.sendRedirect(URl) statelmet follows the out.prinltln() because redreicted URL imediately occupy the browser! I use alots sendRedirect in my project. it works fine. try to use response forward method !