*/
protected void applyDecoratorUsingJSP(Page page, Decorator decorator, HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
request.setAttribute(PAGE, page);
ServletContext context = getServletContext();
// see if the URI path (webapp) is set
if (decorator.getURIPath() != null) {
// in a security conscious environment, the servlet container
// may return null for a given URL
if (context.getContext(decorator.getURIPath()) != null) {
context = context.getContext(decorator.getURIPath());
}
}
// get the dispatcher for the decorator
RequestDispatcher dispatcher = context.getRequestDispatcher(decorator.getPage());
// create a wrapper around the response
dispatcher.include(request, response);
// set the headers specified as decorator init params
while (decorator.getInitParameterNames().hasNext()) {