項目目錄是src,WebRoot以及一些庫引用的目錄,jre Library和j2ee library,WebRoot目錄下是META-INF\MANIFEST.MF,和WEB-INF\web.xml 。WEB-INF下面還有classes,lib,其餘的一些文件,默認的web項目,沒有添加ssh的效果;java
一、添加spring支持web
在web項目名稱上右鍵-〉myEclipse->add spring capabilities ,structs和hibernate都同樣,若是你手動刪除了,還能夠在java build path的配置中心經過添加myeclipse library的方式添加上,經過右鍵的方式最爲快捷spring
看項目中的變化:apache
項目中添加了spring 3.0 core libraries和spring 3.0 AOP libraries 能夠在右鍵->Build Path->Remove Build path 或者config Build path 能夠添加和移除引用庫session
當添加了structs 2.1以後,web.xml中添加了app
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>eclipse
添加hibernate的時候選擇spring configuration file(applicationContext.xml)ssh
在applicationContext.xml中添加了ui
<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="org.apache.derby.jdbc.ClientDriver">
</property>
<property name="url"
value="jdbc:derby://localhost:1527/myeclipse">
</property>
<property name="username" value="classiccars"></property>
<property name="password" value="myeclipse"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
</bean>url
在web.xml中添加
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
spring就ok了