Difference Between Servlets And JSP

Servlets and Java Server Pages are complementary APIs, both providing a means for generating dynamic Web content. A servlet is a Java class implementing the javax.servlet.Servlet interface that runs within a Web or application server’s servlet engine, servicing client requests forwarded to it through the server. A Java Server Page is a slightly more complicated … Read more

Difference Between the Request Attribute and Request Parameter

Request parameters are the result of submitting an HTTP request with a query string that specifies the name/value pairs, or of submitting an HTML form that specifies the name/value pairs. The name and the values are always strings. For example, when you do a post from html, data can be automatically retrieved by using getParameter(). Parameters … Read more

Difference Between Forward and response.sendRedirect

Forward : when forward is used server forwards the request to the new url and the control stays on the same page. in other words it just forward the request to new url and come back fomr where forward is called. sendRedirect : sendRedirect forward the request to url as new request and the cotrol goes to the destination page and never … Read more

Difference Between Forward and Include in JSP

The <jsp:forward> action enables you to forward the request to a static HTML file, a servlet, or another JSP. <jsp:forward page=”url” /> The JSP that contains the <jsp:forward> action stops processing, clears its buffer, and forwards the request to the target resource. Note that the calling JSP should not write anything to the response prior to the … Read more

Difference Between JSP Include Directive and JSP Include Action

<%@ include file=”filename” %> is the JSP include directive.At JSP page translation time, the content of the file given in the include directive is ‘pasted’ as it is, in the place where the JSP include directive is used. Then the source JSP page is converted into a java servlet class. The included file can be … Read more