This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
hi all, i found out something very strange thing abt servlets.i dont know if i am right but anyway.... in one of my servlets, if a particular condition is met i forward the request to a certain jsp page
and if the condition is not met i do some other processing in the servlet itself.today i realized that the request comes back to this servlet after the jsp page execution is over.till now i believed that once request has been forwarded, the control passes on to the called servlet/jsp page. am i right?if i am right what should i do so that the request doesn't come back to the calling servlet.i know i can use the else condition.but in my case there are situations where i cannot use else condition any help would be greatly appreciated. Subbu
According to the API, when the call to forward returns, the response output stream should be flushed and closed, so your calling servlet should not be able to write anything more. However, the thread that calls forward does return to the calling method, so you can do other stuff. Bill
thanks bill for your response. is there anyway i can prevent the execution of the code after the forward statement.can i use something like exit just after the forward statement.is it advisable? thanks. Subbu