Can You Make Use of a ServletOutputStream Object From within a JSP Page

No. You are supposed to make use of only a JSPWriter object (given to you in the form of the implicit object out) for replying to clients. A JSPWriter can be viewed as a buffered version of the stream object returned by response.getWriter(), although from an implementational perspective, it is not. In general, it is … Read more

How does a Servlet Communicate with a JSP Page

The following code snippet shows how a servlet instantiates a bean and initializes it with FORM data posted by a browser. The bean is then placed into the request, and the call is then forwarded to the JSP page, Bean1.jsp, by means of a request dispatcher for downstream processing. public void doPost (HttpServletRequest request, HttpServletResponse … Read more

Is there a Way I can Set the Inactivity Lease Period on a Per-Session Basis

Typically, a default inactivity lease period for all sessions is set within your JSPengine admin screen or associated properties file. However, if your JSP engine supports the Servlet 2.1 API, you can manage the inactivity lease period on a per-session basis.This is done by invoking the HttpSession.setMaxInactiveInterval() method, right after the session has been created. … Read more

How do you Pass Control From One JSP Page to Another

Use the following ways to pass control of a request from one servlet to another or one jsp to another. First is RequestDispatcher object‘s forward method to pass the control. Second is response.sendRedirect method. In Advanced Java, when you want to pass control from one JSP (JavaServer Pages) page to another, you typically use mechanisms … Read more

Can a JSP Page Process HTML FORM Data

Yes. However, unlike Servlet, you are not required to implement HTTP-protocol specific methods like doGet() or doPost() within your JSP page. You can obtain the data for the FORM input elements via the request implicit object within a scriptlet or expression as. Is there a way to reference the “this” variable within a JSP page? Yes, … Read more