springmvc+maven+sitemesh+bootstrap
来源:互联网 发布:中天制片软件 编辑:程序博客网 时间:2024/05/29 16:20
前面把spring mvc+maven+mybatis+logback全做完了,现在加上页面装饰的框架sitemesh+bootstrap
1、在maven的pom.xml加上sitemesh的依赖
<dependency><groupId>opensymphony</groupId><artifactId>sitemesh</artifactId><version>2.4.2</version> </dependency>2、在web.xml中加上SiteMesh的过虑器,过虑器拦截的页面都会被sitemesh的母页装饰
<filter><filter-name>sitemesh</filter-name><filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class></filter><filter-mapping><filter-name>sitemesh</filter-name><url-pattern>/*</url-pattern></filter-mapping>
3、在WEB-INF下加上:decorators.xml
<?xml version="1.0" encoding="UTF-8"?><decorators defaultdir="/WEB-INF/sitemesh/">//定义sitemesh的母页位置<decorator name="main" page="basic.jsp"><pattern>/*</pattern></decorator></decorators
4、在WEB-INF/sitemesh下加入basic.jsp,这个jsp用的是bootstrap的模板,先下载bootstrap模板,用一个自己喜欢的模板,改一下里面的东西,如菜单,header等等,重点是:page-content是由mvc返回的jsp填充
<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator"%>
<div class="page-content-wrapper"><div class="page-content"><decorator:body/></div><!-- END PAGE CONTENT--></div></div>
基本上整个设置已经完成,可能遇到的问题:
1、自己在jsp里写的javascript代码找不到,解决方法:将srcipt的代码放到<body>体中
<body><script src="<%=request.getContextPath()%>/script/textArea.selection.js"></script><script type="text/javascript">var path="<%=request.getContextPath() %>";var pageSize = 100;
附上效果图:
1、没加sitemesh和bootstrap之前
2、加上sitemesh和bootstrap
1 0
- springmvc+maven+sitemesh+bootstrap
- RequireJS, Sitemesh, Bootstrap 组合
- 分布式java shiro、maven、Bootstrap、SpringMVC
- springmvc mybatis 整合 bootstrap maven shiro druid
- SSM springmvc mybatis 整合 bootstrap maven shiro
- JavaEE框架Bootstrap HTML5 jQuery SpringMVC maven
- bootstrap + mybatis + maven + springmvc 实现分页效果
- 分布式java shiro、maven、Bootstrap、Bootstrap、SpringMVC、Mybatis、Hibernate
- springmvc + freemarker +sitemesh
- sitemesh、springmvc装饰配置
- springMvc sitemesh freemarker 整合总结
- springMVC,hibernate,sitemesh,pagerlib整合
- maven springmvc shiro mybatis rest webservice bootstrap整合
- java springmvc mybaits maven shiro mysql 后台框架源码bootstrap
- 系统框架 springmvc mybatis Bootstrap html5 shiro maven
- java springmvc mybaits maven shiro mysql 后台框架源码bootstrap
- maven大型互联网企业架构 SpringMVC Mybatis Shiro Bootstrap
- angularjs+bootstrap+SpringMVC+Spring+mybatis+maven--ui.router路由一
- IOS总结_实现UIButton的图文混排(二)
- Xcode6的新特性、iPhone6和iPhone6Plus的适配
- Python的Tornado框架的REST支持方案
- 【叶子函数分享四十五】返回两个时间范围内的一个随机时间
- Launcher 在配置文件中配置桌面快捷方式->代码分析
- springmvc+maven+sitemesh+bootstrap
- windows程序设计之绘图基础之GDI原理
- 【叶子函数分享四十四】全角半角转换函数
- Android(开发):发送短信
- cannot allocate an object of abstract type
- android之permission和user-permission的使用
- android2.3进入安全模式
- Python性能分析与调试
- 【叶子函数分享四十三】SQL数字转英文函数