I have a program where the servlet will pass a value to the applet (which consists of a JList). Upon clicking an item on the JList, the string selected will be returned back to the servlet (which it did). My servlet would then use this string to do some processing before making a request to other JSPs using request.getRequestDispatcher. I debugged on Eclipse and the debugger did take me to the breakpoint placed in the JSP, thus the request has been forwarded.
I have also read this: java.lang.IllegalStateException: Cannot (forward | sendRedirect | create session) after response has been committed, and made sure that if else or return statements are used to eliminate "Cannot call sendRedirect()" or "Cannot forward after response has been committed" errors.
However, the applet remains on the page and did not change to the JSP page even though the redirection did happen. Is there any way to do this, apart from using showDocument of appletcontext from inside the applet since that means I have to do redirection from within the applet instead of the servlet?
Btw, my forward request looks like this: request.getRequestDispatcher("/myJSP.jsp").forward(request, response); And it is in the doPost method of my servlet class.
Thanks!