自己搭建struts2+spring工程笔记

来源:互联网 发布:php怎样解决高并发 编辑:程序博客网 时间:2024/04/30 22:30
        自己试验着搭建一个struts2+spring的工程.至于持久层的问题,暂时还没有涉及到,初步打算是用hibernate或者ibatis.首先打算先完成struts2和spring的架构.
1.涉及到的jar文件分类
     (1)struts2 :freemarker-2.3.10.jar,ognl-2.6.11.jar,struts2-core-2.0.9.jar,struts2-spring-plugin-2.0.9.jar,
                        xwork-2.0.4.jar,commons-logging-1.0.4.jar
     (2)spring:spring-2.0.6.jar
     (3)jstl:jstl-1.1.2.jar,standard-1.1.2.jar
     (4)mail:activation-1.1.jar,mail-1.4.jar
     (5)sitemesh:sitemesh-2.3.jar
2.国际化
   打算用jstl的fmt来实现.在web.xml中,加入:
    <context-param>
        <param-name>
            javax.servlet.jsp.jstl.fmt.localizationContext
        </param-name>
        <param-value>ApplicationResources</param-value>
    </context-param>
    <context-param>
        <param-name>
            javax.servlet.jsp.jstl.fmt.fallbackLocale
        </param-name>
        <param-value>en</param-value>
    </context-param>
classpath里找到ApplicationResources.properties资源文件.过这样定义的缺点是只能定义一个文件,而如果有多个properties,就惟有在页面用<fmt:bundle>绑定了。
(用到工具native2ascii.exe,或者
eclipse PropertiesEditor 属性文件编辑器,支持直接输入中文,后台自动转unicode。
                                            2种安装方式。
                                                1。下载压缩包。
                                                2。在更新管理器里面添加http://propedit.sourceforge.jp/eclipse/updates/
)

 
原创粉丝点击