步骤一:在myeclipse里面配置数据源
步骤二:在项目名上点击鼠标右键,选择myeclipse选项,选择add hibernate capbilities导入hibernate所需的jar包,根据提示配置hibernate
步骤三:在项目名上点击鼠标右键,选择myeclipse选项,选择add spring capbilities导入hibernate所需的jar包,根据提示配置spring
步骤四:在项目名上点击鼠标右键,选择myeclipse选项,选择add struts capbilities导入hibernate所需的jar包,根据提示配置struts
步骤五:在web.xml中加入如下代码
org.springframework.web.context.ContextLoaderListener
步骤六:在struts.xml中加入如下代码
完成以上步骤,环境便搭建成功了。希望对你有所帮助
使用myeclipse开发工具 步骤一:在myeclipse里面配置数据源 步骤二:在项目名上点击鼠标右键,选择myeclipse选项,选择add hibernate capbilities导入hibernate所需的jar包,根据提示配置hibernate 步骤三:在项目名上点击鼠标右键,选择myeclipse选项,选择add spring capbilities导入hibernate所需的jar包,根据提示配置spring 步骤四:在项目名上点击鼠标右键,选择myeclipse选项,选择add struts capbilities导入hibernate所需的jar包,根据提示配置struts 步骤五:在web.xml中加入如下代码 <listener> <listener-class> org.springframework.web.context.contextloaderlistener </listener-class> </listener> <context-param> <param-name>contextconfiglocation</param-name> <param-value>classpath*:applicationcontext*.xml</param-value> </context-param> <filter > <filter-name>charfilter</filter-name> <filter-class>org.springframework.web.filter.characterencodingfilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf8</param-value> </init-param> </filter> <filter-mapping> <filter-name>charfilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter > <filter-name>lazyfilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.opensessioninviewfilter</filter-class> </filter> <filter-mapping> <filter-name>lazyfilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> 步骤六:在struts.xml中加入如下代码 <controller processorclass="org.springframework.web.struts.delegatingrequestprocessor"> </controller> 完成以上步骤,环境便搭建成功了。希望对你有所帮助