4: Developing applications > 4.2.1.3.3.1.1.1: Example: Extending PageListServletSimplePageListServlet is an example of a servlet that extends the PageListServlet class and uses its callPage() method to invoke a JSP: public class SimplePageListServlet extends com.ibm.servlet.PageListServlet { public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { try{ setRequestAttribute("testVar", "test value", req); setRequestAttribute("otherVar", "other value", req); String pageName = getPageNameFromRequest(req); callPage(pageName, req, resp); } catch(Exception e){ handleError(req, resp, e); } } }
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||
|