使用decorator模式对jsp页面布局

[size=medium]使用decorator模式对jsp页面进行布局:

步骤:

1.web.xml:


sitemesh
com.opensymphony.sitemesh.webapp.SiteMeshFilter


sitemesh
/*



2.新建decorator.xml文件 配置需布局对象与不需要布局对象:








/login

/uploadImage/**

/category/preview1/**

/category/previewNews

/category/preview/preview/**






/pass

/category/**

/account/**
/activity/**




3.新建decorator.jsp


<%@ include file="../taglibs.jsp"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>






<decorator:title />




<%@ include file="../menu.jsp"%>

<%@ include file="../nav.jsp"%>








[/size]

你可能感兴趣的:(java)