1 9 10 package com.opensymphony.module.sitemesh.mapper; 11 12 import com.opensymphony.module.sitemesh.Decorator; 13 import com.opensymphony.module.sitemesh.Page; 14 import com.opensymphony.module.sitemesh.RequestConstants; 15 import com.opensymphony.module.sitemesh.factory.FactoryException; 16 17 import javax.servlet.http.HttpServletRequest ; 18 19 32 public class InlineDecoratorMapper extends AbstractDecoratorMapper implements RequestConstants { 33 public Decorator getDecorator(HttpServletRequest request, Page page) { 34 Decorator result = null; 35 if (request.getAttribute(DECORATOR) != null) { 36 String decoratorName = (String )request.getAttribute(DECORATOR); 38 result = getNamedDecorator(request, decoratorName); 39 if (result == null) throw new FactoryException("Cannot locate inline Decorator: " + decoratorName); 40 } 41 return result == null ? super.getDecorator(request, page) : result; 42 } 43 } 44 | Popular Tags |