What is the source code for include() & forwrd() method
servlet program?
Answer / sunny
1. forward should be called before the response has been
committed to the client.
public class Dispatcher extends HttpServlet {
public void doGet(HttpServletRequest req,
HttpServletResponse res) {
RequestDispatcher dispatcher =
request.getRequestDispatcher
("/template.jsp");
if (dispatcher != null) dispatcher.forward
(request, response);
}
}
2. Includes the content of a resource (servlet, JSP page,
HTML file) in the response.
public class Dispatcher extends HttpServlet {
public void doGet(HttpServletRequest req,
HttpServletResponse res) {
RequestDispatcher dispatcher =
getServletContext
().getRequestDispatcher("/banner");
if (dispatcher != null) dispatcher.include
(request, response);
}
}
Is This Answer Correct ? | 0 Yes | 1 No |
What does “1?+2+4 Evaluate to? What about 5 + 4 + “3??
Where are cookies actually stored on the hard disk?
disbable back option by java script
What are the types of variables in javascript?
<script type="text/javascript"> function dispValue(e) { v = function (s) { return e.name + ': ' + s } if (e.type == "") return v(e.checked ? "" : ""); else return v(e.value); }
What is the difference between null & undefined?
What is postback in javascript?
What is lazy instantiation in java?
write a programme to solve a formula for compound interest using html tags. I want to know how a formula containing degree (raise to the power) can be solved.
List some features of javascript.
What are the datatypes in javascript?
What are all the types of Pop up boxes available in JavaScript?