`

sitemesh2 集成velocity 装饰页面乱码

阅读更多
请参考:
http://www.cnblogs.com/andrewlee/p/3825653.html

通过改写类 VelocityView 的 getTemplate 方法
public Template getTemplate(String name, String encoding)
    {
        try
        {
            if (encoding == null)
            {
                return velocity.getTemplate(name,"UTF-8");
            }
            else
            {
                return velocity.getTemplate(name, encoding);
            }
        }
        catch (RuntimeException e)  // FIXME This is useless with Velocity 1.7
        {
            throw e;
        }
        catch (Exception e)  // FIXME This is useless with Velocity 1.7
        {
            throw new RuntimeException(e);
        }
    }


代码位置
http://svn.apache.org/viewvc/velocity/tools/tags/2.0/src/main/java/org/apache/velocity/tools/view/VelocityView.java?view=log
分享到:
评论

相关推荐

    struts2+spring2+hibernate3+velocity+sitemesh集成框架代码

    集成了struts2,spring2,hibernate3,以及velocity和sittemesh的项目源代码,有兴趣的可以下载下,关键是集成velocity有点难度,呵呵.

    spring mvc sitemesh velocity整合

    Spring MVC框架,整合了velocity,这个没有用到Hibernate,下一版本会把集成Hibernate

    页面装饰器(sitemesh)实例源代码

    用sitemesh页面装饰器,将大名鼎鼎的开源即时通讯服务器openfire中运用的,布局页面抽取出来。MyEclipse中可以直接部署的代码。

    Struts2整合SiteMesh技巧

    概述 Struts 2.0提供一个Sitemesh插件... 缺省情况下,sitemesh假定装饰器文件保存在应用上下文根路径下的decorators目录下,如果采用如上配置,装饰器文件应该是ftl格式,如果需要使用其他格式,需要更改过滤器配置。

    sitemesh-3.0.1-javadoc

    SiteMesh是一个网页布局和装饰框架以及Web应用程序集成框架,可帮助创建由页面组成的网站,这些页面需要一致的外观,导航和布局方案。 SiteMesh会拦截对通过Web服务器请求的任何静态或动态生成的HTML页面的请求,...

    sitemesh

    sitemesh 装饰 母版

    sitemesh-3.0.1.jar

    sitemesh 装饰页面技术.

    sitemesh简单教程页面装配器

    sitemesh 应用 Decorator 模式,用 filter 截取 request 和 response,把页面组件 d,content,banner 结合为一个完整的视图。通常我们都是用 include 标签在每个 jsp 页面中来 断的包含各种header , ...

    sitemesh教程-页面装饰技术原理及应用

    Sitemesh是一种页面装饰技术:它通过过滤器(filter)来拦截页面访问,据被访问页面的URL找到合适的装饰模板等等,感兴趣的朋友可以了解下哦

    java sitemesh 页面框架

    页面框架 布局,使用方便,已经配置好了,包也在里面

    JSP布局框架SiteMesh.zip

    Sitemesh是由一个基于Web页面布局、装饰以及与现存Web应用整合的框架。它能帮助我们在由大 量页面构成的项目中创建一致的页面布局和外观,如一致的导航条,一致的banner,一致的版权,等等。 它不仅仅能处理动态的...

    sitemesh 完美合集 4个资料和jar文件

    在WebWork中集成SiteMesh相当容易: 实际上什么也不用做. WebWork把全部值栈数据都保存在请求attribute中, 这意味着如果想显示值栈(或ActionContext)中的数据, 只需使用WebWork附带的标准标签库, 就这么简单!那来看完...

    siteMesh demo 例子

    入门的demo...siteMesh与freemarker结合。。 siteMesh与velocity结合。。并且在siteMesh.xml用了不同的装饰器。。每个装饰器都有注释。。可以帮助理解。。请看readme.txt

    SiteMesh教程及SiteMesh官方文档翻译

    web布局框架 SiteMesh教程及SiteMesh官方文档翻译

    jsp 页面框架sitemesh 全面帮助文档及示例

    jsp 页面框架sitemesh 全面帮助文档及示例

    MiddleGen+Sitemesh.zip

    201.2.0/middlegenide_1.2.0.zip/download?use_mirror=nchc 下载文件:middlegenide_1.2.0.zip (7)Sitemesh: 本书使用版本:2.2 官方网站:http://www.opensymphony.com/sitemesh/index.html 下载页面:...

    网络应用程序整合框架SiteMesh源码

    SiteMesh是一款网页布局和装饰器框架,也是一个网络应用程序整合框架,它可以用来维护那些很多页面,并且希望保持所有页面的布局、链接和风格一致的大型网站应用整合与维护。使用SiteMesh可以抽象出页面中的公共布局...

    struts2-sitemesh-plugin-2.2.1.1.jarstruts2

    struts2-sitemesh-plugin-2.2.1.1.jarstruts2

Global site tag (gtag.js) - Google Analytics