项目目录是src,WebRoot以及一些库引用的目录,jre Library和j2ee library,WebRoot目录下是META-INF\MANIFEST.MF,和WEB-INF\web.xml 。WEB-INF下面还有classes,lib,其他的一些文件,默认的web项目,没有添加ssh的效果;
1、添加spring支持
在web项目名称上右键-〉myEclipse->add spring capabilities ,structs和hibernate都一样,如果你手动删除了,还可以在java build path的配置中心通过添加myeclipse library的方式添加上,通过右键的方式最为快捷
看项目中的变化:
项目中添加了spring 3.0 core libraries和spring 3.0 AOP libraries 可以在右键->Build Path->Remove Build path 或者config Build path 可以添加和移除引用库
当添加了structs 2.1之后,web.xml中添加了
struts2
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
struts2
*.do
添加hibernate的时候选择spring configuration file(applicationContext.xml)
在applicationContext.xml中添加了
class="org.apache.commons.dbcp.BasicDataSource">
value="org.apache.derby.jdbc.ClientDriver">
value="jdbc:derby://localhost:1527/myeclipse">
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
org.hibernate.dialect.SQLServerDialect
在web.xml中添加
contextConfigLocation
classpath:applicationContext.xml
org.springframework.web.context.ContextLoaderListener
spring就ok了