1 9 10 package com.opensymphony.module.sitemesh.mapper; 11 12 import com.opensymphony.module.sitemesh.Config; 13 import com.opensymphony.module.sitemesh.Decorator; 14 import com.opensymphony.module.sitemesh.DecoratorMapper; 15 import com.opensymphony.module.sitemesh.HTMLPage; 16 import com.opensymphony.module.sitemesh.Page; 17 18 import javax.servlet.http.HttpServletRequest ; 19 import java.util.Properties ; 20 21 35 public final class FrameSetDecoratorMapper extends AbstractDecoratorMapper { 36 private String decorator = null; 37 38 public void init(Config config, Properties properties, DecoratorMapper parent) throws InstantiationException { 39 super.init(config, properties, parent); 40 decorator = properties.getProperty("decorator"); 41 } 42 43 public Decorator getDecorator(HttpServletRequest request, Page page) { 44 if (page instanceof HTMLPage && ((HTMLPage)page).isFrameSet()) { 45 return getNamedDecorator(request, decorator); 46 } 47 else { 48 return super.getDecorator(request, page); 49 } 50 } 51 } 52 | Popular Tags |