1. JSP forward or include? coderanch.comWhen you use forward the invoker will not have an access to request any longer ( request & the control will be forwarded to destination ). If you use include, request object thus the control will return to the invoker that calls include after the destination is done with processing the request. |
2. include vs forward coderanch.compooja, The |
3. forward() VS include() coderanch.com |
4. A forward in a include page? coderanch.comHi All This is my case: I have a top.jsp file which I include in every page. It not only has all the stuff of the page header and all the links it also contains a part which does a security check. Meaning if someones session is expired or for any other reason does not have a valid session to view ... |
5. jsp:forward and jsp:include coderanch.com |
6. How to forward to other JSP when we use include coderanch.comYou have to decide what to display before you display anything. In your case, you aren't sure what to display, but you are including a file then deciding what you really wanted was to redirect. This may still not be what you need, but it removes that conflict. String sStatus = (String) req.getAttribute("Status"); String name= ""; if (!sStatus.equals("OK")){ res.sendRedirect(sStatus); } else ... |
7. forward() does not work with jsp:include coderanch.com |
8. How to figure if a servlet invoked as include or forward coderanch.com |
9. About Forward and Include method in Servlet coderanch.comHi sharma, its very simple... see forward -- request goes to another resource from current position ,you cant print anything after this statement.if you do so it throws an exception where as include : you are processing another resource with in your page .. you can print anything after this statement.no problems i think you understand clearly... |