随笔 - 79  文章 - 11  trackbacks - 0
<2009年2月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
1234567

不再堕落。
Oracle documents: 
http://tahiti.oracle.com/

常用链接

留言簿

随笔分类(66)

随笔档案(79)

相册

收藏夹(11)

搜索

  •  

积分与排名

  • 积分 - 51950
  • 排名 - 952

最新随笔

最新评论

阅读排行榜

http://www.liyonghome.cn/index.php/archives/6.html

首先是准备工作吧,需要以下软件,均可到官方网址下载
Struts2: http://apache.etoak.com/struts/binaries/struts-2.0.14-all.zip
Spring2.5: http://www.springsource.org/,下载spring-framework-2.5.zip(可选)
common-pool: http://www.apache.org/dist/commons/pool/commons-pool-current.zip
MyEclipse7: http://www.myeclipseide.com/

      由于Myeclipse的最新版本7.0依然不支持struts2,所以我们需要手动去导入struts2相关jar文件和配置文件,之后使用Myeclipse自动再依次导入Spring2.5,Hibernate3.2。

一,建立一个新项目:
1.进入new project,选择Web Project.
2.Project Name输入”SSH2Demo”,另外选择Java EE 5.0,之后点击finish创建项目.

二,手工导入Struts2:
1.解压struts-2.0.14-all.zip,找到lib文件夹.copy一下的jar文件到/WEB-INF/lib,当然这并一定是最精简的,但是至少没有问题.  [xwork-2.0.7.jar, xml-apis-1.0.b2.jar, struts2-spring-plugin-2.0.14.jar, struts2-core-2.0.14.jar, oro-2.0.8.jar, ognl-2.6.11.jar, freemarker-2.3.8.jar, classworlds-1.1.jar, aopalliance-1.0.jar, antlr-2.7.2.jar以及commons-*.jar]

2.更新web.xml文件,加入
 <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
 <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

3.接着创建struts.xml,放到/WEB-INF/classes.
<?xml version=”1.0″ encoding=”UTF-8″ ?>
<!DOCTYPE struts PUBLIC
    “-//Apache Software Foundation//DTD Struts Configuration 2.0//EN”
    “http://struts.apache.org/dtds/struts-2.0.dtd“>
<struts>
    <!– action内容 –>
</struts>

posted on 2009-02-18 23:43 donnie 阅读(1133) 评论(0)  编辑  收藏 所属分类: java

只有注册用户登录后才能发表评论。


网站导航: