Discuss various scopes of JSP objects briefly. Create HTML File with principal, time and rate. Then crate a JSP file that reads values from the HTML form, calculates simple interest and displays it.
SCOPE OF JSP OBJECTS The availability of a JSP object for use from a particular place of the application is defined as the scope of that JSP object. Every object created on a JSP page will have a scope. Object scope in JSP is segregated into four parts and they are page, request, session, and application. a) Page Scope- page scope means, the JSP object can be accessed only from within the same page where it was created. JSP implicit objects out, exception, response, pageContext, config, and page have page scope. //Example of JSP Page Scope <jsp:useBean id="employee" class="EmployeeBean" scope="page" /> b) Request Scope- A JSP object created using the request scope can be accessed from any pages that serves that request. More than one page can serve a single request. Implicit object request has the request scope. //Example of JSP Request Scope <jsp:useBean id="employee" class="EmployeeBean" scope="request" /> c