0

Hi,

how can I call another JSP without transferring control to that. The response.sendRedirect is transferring control to the next jsp page. I still have some code after the response line which needs to be executed but it doesnt gets executed.

Any suggestions?

Thanks

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by filestofiles
0

Sorry I do no see logic in what you trying to do. Redirect is for giving up current document and moving on next one and not holding on old location.

Will you explain what you are up to?

0

ok. let's say I have Main.jsp and newpage.jsp. let statements in main.jsp be like
int i = 1;
response.sendredirect("newpage.jsp");
i=3;
out.println(i);

currently, running this code will transfer control to newpage.jsp and will not execute the next two lines. how can i execute the next commands after running newpage.jsp. I do not wish to transfer control to newpage.jsp. it may run in background. I know only of response.sendRedirect now. Is there a way to achieve the above mentioned objective?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.