41 . Explain about autoflush?
This command is used to autoflush the contents. If a value of true is used it indicates to flush the buffer whenever it is full. In case of false it indicates that an exception should be thrown whenever the buffer is full. If you are trying to access the page at the time of conversion of a JSP into servlet will result in error.
42. How do you restrict page errors display in the JSP page?
You first set "errorPage" attribute of PAGE directive to the name of the error page (ie errorPage="error.jsp")in your jsp page .
Then in the error.jsp page set "isErrorpage=TRUE".
When an error occur in your jsp page, then the control will be automatically forward to error page.
- page - with in the same page
- request - after forward or include also you will get the request scope data.
- session - after senRedirect also you will get the session scope data. All data stored in session is available to end user till session closed or browser closed.
- application - Data will be available throughout the application. One user can store data in application scope and other can get the data from application scope.
value="<%=java.text.DateFormat.getDateInstance().format(new java.util.Date()) %>" / >
No problem! The use Bean action specifies the beanName attribute, which can be used for indicating a serialized bean.
A couple of important points to note. Although you would have to name your serialized file "filename.ser", you only indicate "filename" as the value for the beanName attribute. Also, you will have to place your serialized file within the WEB-INF/jspbeans directory for it to be located by the JSP engine.
- By include directive:
- By include action:
- by using pageContext implicit object
- by using RequestDispatcher object
RequestDispatcher rd = request.getRequestDispatcher(“/header.jsp”);
<%@ include file=”header.jsp” %>