Java Web项目实战第1篇之环境搭建
写在前面的话
从今天开始一个Java Web实战项目,参考自 http://blog.csdn.net/eson_15/article/details/51277324 这个博客(非常感谢博主的分享精神)。本博客系列文章也会参考前面博客中项目的进度来写,因此标题可能高度相似,章节结构也可能相似,只是内容排版和行文上会有些区别。
现在开始记录我开发的过程,争取每一个项目中的每一个知识点都有一个比较详细的记录,对每个知识点尽可能记录总结好1. 基本原理,2.框架/工具使用配置, 2.框架/工具/解决方案的基本用法。技术能力需要在实践中得到提高,概念也需要从实践中才能深刻理解,但是光做项目不够,还需要做总结,消化做过的项目,才能真正变成自己的知识。
需要说明的是本博客是边开发变记录, 因此很多东西可能不会很准确,也不会很全面, 后续会逐步订正和完善的。
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
下面开始本项目第一篇,环境的搭建,本项目主要使用主流框架SSH来完成。 搭建环境的整体步骤是是,
- 搭建好Java Web基础环境, 创建基本的web.xml配置文件
- 导入Spring框架Jar包,创建webContext.xml等配置文件,同时在web.xml中配置监听器(listener)来监听Spring容器对象的创建,这样就将Spring框架集成进了Java Web项目。
- 导入Hibernate框架Jar包,Hibernate大部分配置都将直接写入Spring的配置文件中,这样就将Hibernate也集成进了Java Web项目
- 导入Struts2框架Jar包,需要创建struts.xml用来配置Action, 同时在web.xml中配置过滤器(filter), 拦截器 (interceptor) 用来接管HTTP请求,这样就将struts2集成进了Java Web项目。
一、搭建Java Web基础环境
这个步骤需要注意的是做好java web的基本设置,例如编码之类。以及tomcat的一些基本配置。
1.tomcat的基本配置
下载tomcat,也可以下载xampp集成包,因为里面带有mysql使用方便。解压tomcat目录结构如下,
如果单独配置tomcat,我们需要使用如下一些配置文件
bin:二进制执行文件。里面最常用的文件是startup.bat,如果是 Linux 或 Mac 系统启动文件为 startup.sh。 启动tomcat后
conf:配置目录。里面最核心的文件是server.xml。可以在里面改端口号等。默认端口号是8080,也就是说,此端口号不能被其他应用程序占用。
lib:库文件。tomcat运行时需要的jar包所在的目录
logs:日志
temp:临时产生的文件,即缓存
webapps:web的应用程序。web应用放置到此目录下浏览器可以直接访问
work:编译以后的class文件。
如果启动上面的startup.bat, 在浏览器输入 http://localhost:8080/, 则可以看到tomcat的控制台页面(经典的汤姆猫页面),本篇暂不对tomcat的管理页面做介绍,因为本项目将使用Eclipse集成tomcat搭建web服务器。
如果要在Eclipse中集成tomcat,则不需要改动以上配置,直接在Eclipse中新建一个server,将路径指向tomcat的根目录即可,并且无需进入tomcat的bin目录去启动tomcat,而是直接在Eclipse中启动。
在Eclipse搭建基本的Java Web运行环境步骤如下,
- 在windows->show view->server中,添加tomcat的根目录。 Eclipse将自动配置和部署tomcat,不需要手工拷贝class文件。
- 新建一个java dynamic web 应用程序, 其target runtime选择刚才配置好的tomcat, 并勾选自动生成web.xml
- 完成前面2步,我们看到在新建的web工程的build path中,已经添加了apache tomcat library了, 此时就可以在WebContent中新建一个index.jsp, 启动tomcat,然后测试这个jsp文件(Run As->Run on Server).
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAARwAAACdCAIAAADpDVB+AAAQbUlEQVR4nO2dXXAURQLH9x588WkfrJw8XJ1WUQrneSmChXhcoYcegdMSDksFz4877kBKKINRvES+UhgkghRfCSAoIhiEhGBCIMRADnABEaNZUCBngCQgEiBAghAHSOx7mLBOpj+mZ6ZnZ3bz/9W/Urs93T2dSf/5985us6EtX/0AQZBChXwfAQQlmUJFpTshCFKoUNMP7RAEKRRMBUGKBVNBkGL9YqqKHTUQBLlXiBCiPyIgvuiX/VBTK5RkCsFO/gJfJZ9Cfk8qAF8lm2Aq/4GpElc5OTmEEFMhTBUIKnbUHGxshXjy2hvVuSnVuSkwVVIBU1moyUNV56b83HmpOjfFQVvdVKZCtqkyXs+N76Tq6cBUdlVYFhFLsh/dUV2msj+MLlN1L7Q21e437o3MGLT4iTsjMwZFZgyK0yzrYVTsqDnYeAnii2Gqwz8SniRNVZ2b8rN2vFM7/rN2Ql8BmuSVqapfv+d6e1X+6L7X26t2Zj+gahq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d3p578nQ3/eidsp+T4YuCgbEtJ8aMwV/UkJqnNFzTixv/JSUFAzDMAxj/zpIQUFBPP/wBiReK+b3ZDAMY/8SC9W9qGTs30WhqkMcIpa/2sl+nzSavw+lVuPYr+JTIsdMxqyYrzRJcTLo1ev1fHMKROOQ7/Ywml2r1bIvnAZG9aTUCvt9OIPBQGXRarWMP/bg/NEysi7EIXr57L8PKSgoiP5nmzIzMwUZlnQ3ERknX/MyWlVM42AYVlRURNFOflEi7+OpqakFBQUGg6GpqQnG8+QU/N4rCKR+AecgkPoFnINA6hdwDgKpX8A5CKR+AecgkPoFnINA6hdwDgKpX8A5CKR+/R/oSfDeWfYLdQAAAABJRU5ErkJggg==" alt="" />
这样就算是配置了好了一个能运行的java web应用了, 注意上面的web.xml如果没有自动生成, 可以直接拷贝 tomcat根目录的webapps\examples\WEB-INF\web.xml来用;
如果上面的tomcat library没有导入进web工程, 也可以手动在build path->libraries->Add libraries->Server Runtime中添加tomcat。
2. Eclipse配置全局的编码类型
如果不尽早统一编码, 由于后续需要往工程中添加jsp, java, xml 等多种不同类型的文件, 同时还需要连接数据库, 不同编码的数据在不同载体中传输存储,势必会引起乱码问题, 因此需要尽早统一编码。
在Eclipse中,默认编码是ISO-8859-1,不支持中文,可以设置全局的缺省字符编码(即默认编码),设置步骤如下。
a. windows->preference->general->workspace, 设置textfile encoding 为UTF-8
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUAAAACtCAIAAABOXzEVAAAOWElEQVR4nO2dTZKsOBKEWfc5+iB1nj5FHq+Xs4j7MIuc4VGKH0KBRATgbm5loBSSAH3pVCZULaupz+djV9i0LItzWXu1q/K2bLRmNMJrJor+8+/356E/n8/Pz4/d2veUOVtz1oTLetg8trH8qlkVeeOVjaa0fsVqRrO5IgAMR30wj/0JDIVFABiOulAQvVYEgOGokcD5IgAMR40EzhfVBvizU/p87fW9Bh8Y7akETt9hv/uQulZUFeDvTPrZ6S4k3G7w4dGeSuD03fb7zG7OFpUEe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1/k6AP4CaQF+mWY4T2eQ2kdwXAd9PhE/yNOgBuSkSAjRLIr4EMvxDg9DFc7LU3gZsQXsynDqBeERL43Gx+oY4B1i6Y+Spfhno1kOG3Afxy9wHsXIa6REhgOGr5eeCmxAAVl9BDREhgOGRQly9CAsNRA+ASIiQwHDIAzhchgeGoAXAJUVICQ3cXAM7XQHrXHoAn7hJ0lQBwCaUkMPwAA+B8UVICww8wAC4hQgLDIc96Hrh5qlssgb4iJDAc9azngfG4UpcICQyHPOt5YADsFyGB4aj/C+o42mXQokfMAAAAAElFTkSuQmCC" alt="" />
b.windows->preference->general->content types, 将右边所有文件都设置为UTF-8
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZYAAAC+CAIAAACZEr4uAAAZNUlEQVR4nO2da3AUVaLH+/Oue6+v1au7d32CCgTwEYxCgCSEBSQaQiJLgCQQwjPkRQIGkkx4RMIjgIiICi7uri9WV1gQdlddH7dql/Vyq9yy/YKFIBZUWQhVWKDyqe+HHsbOefXpnp7pc7r///rXVPeZ06fPdJ/+5d893RPj4P+dgWEY1tRG6D2AYRj2bSAMhmGNbezd9z4Mw7CmNr48851t85MjMAzDerkfwiwIgiCtRCIsdKbCMAzL2zj07lHbJhAGw7BuNuwwRiDsJ3cuStM/HbDopwMW275q4OKrBtZfNbD+qrvqf5b0kv+4+4rvafjPlAc1Xm17cOPVgxuvGdx0zeCma4Y0XTuk6dohzdfmNF+b03xdTvN1OS3XDW25bmjL9UNbrh/Wcv2wpT+3PXzpz4e33jC89YZ7bbfdeG/bjfcl/V/3L7N90/3Lbnpgue2bc5ffnPuE7V+MsN3+iwfbf5n0iv/Ou+KHVv4q5YdX3vJwxy0Pd9wysuPWkR23juy8dWTnraM6bxvVeduortvyu27L77rd9ujE7aMTd4xO3DEmcceY7jttj+2+c+yqAWNXDShIemDB6oGFSd9VtMb23UVr7h631vY9xbZ77inuGTTe9pODf53yuiETrnjiupyJvUlP6h06af3QSeuHPrJ+2CPrhz2yYdgjG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gdBQlhEGQLf1SGORbQBgUPSGFxUhAGBQ9IYXFSEAYFD0hhcVIQBgUPSGFxUhAGBQ9IYXFSEAYFD0hhcVIQBgUPemUwhS/cVR9AWFQ9KRTCuPdbw1JCgiDoif9Upj80yS8BztiKyAMip40S2E0v4hpcUnMBYRB0ZNaKcz198IEj+YSQQzPzdICwqDoSbMUZklc1Becb2a4g6oLCIOiJ7VSmFiCnzERTIsLYyUgDIqe9EthxDTvN56c04hgtoAwKHrSKYVJCrTiCQiDoiedUpikgDCegDAoeopgCoN4AsKg6CmCKQziCQiDoieksBgJCIOiJ6SwGAkIg6InpLAYCQiDoqf/BzWVGKJXaduqAAAAAElFTkSuQmCC" alt="" />
c. 如果以上方法不起作用,还可以尝试直接找到相应类型的文件设置编码,如下
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlUAAADWCAIAAAB33+C6AAAgAElEQVR4nO2deXgUZZ7H++91Zmec0XHn2HE8x1E5PHBQOQIIAoICBh1uBFHuEEhEjiTNpeG+kVsOlYgk5AYFQYJCA1Hj+rqjMCEBDIyLyQ6uOPjP1v5R3b3V9R71VnV11/X9Pp8nT/Xbb71V1V1dn/yqu6tDlR9fBAAAAIJGyPE1AAAAANIP/AcAACCIwH8AAACCCPwHAAAgiMB/AAAAgkhod+lhAAAAIGiEzl38gdRFAAAAgEAR9Z+CIAiCIEHK//vPcRUDAAAAaSNUfbCWwH8AAAACht5//3L7+CS57o7x190x4bo7Jlx354Sf3DnhJ3dO/MkfJ/40yqSf3jXpX1X+NPlnKndP/tndWT9XuSfr+numXH/PlOvvnXL9vVN+cW/2L1pl/6JV9i9bZf+y9VSVG1pPvaHNtBvaTLuxzbQb2067sW3OjW1zfnWfSu5N9+XedL/KS//2QJRfPzg9Srvpv2k3/TftXv5Nu5d/+5DKjN/+ecbvVNrP/Pc4D8/6vcojs25+ZPbNj8y++dHZNz86+w+P5v2hQ94fOuTd0iHvlg75t3TMv6Vj/q0d82/tVHBrp4LbOhXc1rngts7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b7UFfVJXIBLX+0/7MNKNvG6085h3wX8AAC3qsej/AD1lYs6HDfwVAAAAAElFTkSuQmCC" alt="" />
二、搭建Spring环境
1.基本的Spring 容器环境搭建
Spring中的jar包多达六七十个,但我们并不需要使用全部jar包。
按照Spring4.2.4 reference大致可以分为,core, aop, message, data access, web, test这6个模块, 我们也可以在Eclipse中分别创建不同的user library, 参考上面博客的分法,我也创建了如下library.
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXwAAAF3CAIAAAApQmdeAAAgAElEQVR4nO19XWxd15UeX/R+HwzEj478A6M/iQZjZNKnFMG0kevBtChQwNDDNHkw4IeB3aSdWm6MmatGmfEoMmTLZsRgBFea1FMrybgSGTlXkpVaCN1RZUem5QzDxLFI/TjUDEnxT7q8V6Z8+kD7+HCvtb69zv/Z5PpwcXHuPmut/Z199vrOOrznbg5ERaDdbsfbAwMDbLuDzw1+VXqNtVtTh1oTz7YWJjqsb9xFciNG0gy0KF3YflljGlxjKXXquAMaae1t9DA34GsoBOKYAr2QjAfWI26n71EUbWlv39l5ir62tLcvTHTGnm5d69w18XSLJ82lDd3rtHjnpXe24akpsQITFxhULDog+GYePROdMlDMmGaodLa0t0uvKIrG2q1rnbvG2rlEx1FATdo4LlK/kjvLik1jQEwKS/vVcAMfbfSU3AzFoshK5+OICtE5840v4dfaHdbYTuYOa4AggpOYbdEYUBSSNvp+yxAdG70M3AzFovhKR9N++tEHfn3469Lr9KMPLEx0zu5sXTt659mdbrHDTqPC06a8a3WqdPXmDO1U0yMgYKNnolM2Cqt0JLD2rz58zy/2PLT2enf9xrt7Hnr14XuiKEorOslLd7zLacSXd8eAgnbtBAcbLA2nRdMjMJDIa0THRo8lLx2LIQ/qGdOjD96x9jr24B1Ht3/yevCOo9s/bomi6OzO1tpLE9AmB4B3cGz0JNjIlIFiKp1CHPPAJgcALkAiGz0O3kEzZIaNqcFgqBTFVzoGg8EAsEFurwwGQyiw2yuDwVApGlfpLEx0pg6Jv7oyGAyho3GV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uvHByz7+anTzvMjbRMRhCRj1JeOQ//bPZv/vmqae/NHvuv/fee7733vO9917o/Waw95vv9n5zoPf+0Oxbf/Hqt788c/Hn1NdEx2AIGvVUOi/98T85/me/N/PGn/T+/lu9v9/d+/tv98b/vDf+F73xp3u//Mt/fOO//Xj37//j+4ziRMJfhdkloOwPyQZDA1FPEv78fz/z/T/+pz/4L7/zw//6wI92fuFvn/ziK09+8ZUnv/i3T37x+O6v/L+/+ebN+elaiBkMhrJhv70yGAyVwm43DAZDpbBKx2AwVAoTHYPBUCns9spgMFQKq3QMBkOlsEW8DAZDpSim0qH/u8f7T3wyL+KVFvZAoMHQKBSTkJK4SO1FLeKl+YkDaE/7mHJa/TK9MxgoCqt0UrUXtYhXZtHJJgcmOgZDftRT6eRcxAtv0yW+wKJfTmSvo+ajZGAwGKIo+v+8kqPYgRea9gAAAABJRU5ErkJggg==" alt="" />
当我们导入core和aop两个library之后,就已经可以进行Spring最基本的IOC特性的测试了,下面是一个简单的测试用例。
2. Spring test模块简介
Spring的test模块中,org.springframework.test.context.junit4包提供在Junit下进行Spring集成测试的功能, 其中SpringJUnit4ClassRunner类提供了Spring容器,注解功能。
要在Junit中做基本的Spring容器测试,只需要在测试类头部添加注解 @RunWith(SpringJUnit4ClassRunner.class)
Junit默认会从类加载目录加载applicationContext.xml配置文件,当然也可以通过类头部的 @ContextConfiguration(locations="classpath*:testSpringContext.xml") 自定义配置文件,
如果在测试类中定义一个自动装配的容器对象
@Autowired
private ApplicationContext ctx
则此容器对象就能自动根据Junit测试类默认的spring配置文件或者自定义的配置文件进行初始化,
此时就能直接在测试类中使用Spring容器对象去加载Spring中的bean了! 一个基本的Junit集成Spring测试类如下,
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="classpath*:testSpringContext.xml")
public class TestSpring {
@Autowired
private ApplicationContext ctx; @Test
public void testSpringIoc() {
TestBean tb = (TestBean)ctx.getBean("testBean");
tb.test();
}
}
现在就在当前的J2eeShop工程中通过Junit测试Spring容器的基本功能,
先创建一个测试Bean,
package test; public class TestBean implements java.io.Serializable {
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public void test() {
System.out.println("this is TestBean.test()");
System.out.println("name="+this.getName()+",age="+this.getAge());
}
}
从spring的文档中拷贝一个配置文件模板内容,在6.2.1 Configuration metadata章节就有一个,然后配置一个最基本的测试bean
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <context:component-scan base-package="test" /> <bean id="testBean" class="test.TestBean">
<property name="name" value="zhangsan" />
<property name="age" value="25" />
</bean>
</beans>
创建一个Junit测试类,
package test; import static org.junit.Assert.*; import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="classpath*:testSpringContext.xml")
public class TestSpring {
@Autowired
private ApplicationContext ctx; @Test
public void testSpringIoc() {
TestBean tb = (TestBean)ctx.getBean("testBean");
tb.test();
}
}
执行结果,
this is TestBean.test()
name=张三,age=25
3. 在Web工程中集成Spring
我们上面的步骤仅仅是单独地配置了Web环境和Spring环境,并没有将两者集成起来。 我们在web.xml中配置<context-param>, 用来指定Spring容器的配置文,添加一个<listener>,用来监听Spring容器对象。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml, /WEB-INF/daoContext.xml</param-value>
</context-param> <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
这样,当Java web应用启动时, 会负责根据Spring配置文件来初始化一个Sping的容器对象。
4. Java Web加载Spring原理及简单测试
像上面那样将Spring集成到Java web中后,Spring容器就会随着java web应用的启动而启动,但是整个过程的基本原理是怎样的呢。
要弄清楚这个问题,需要先搞清楚java web应用,即servlet在tomcat中的启动过程。
4.1 Java Web应用程序的启动过程
以下文章详细描述了servlet在tomcat中的工作原理,
Servlet 工作原理解析 - https://www.ibm.com/developerworks/cn/java/j-lo-servlet/
Tomcat 系统架构与设计模式,第 2 部分: 设计模式分析 - https://www.ibm.com/developerworks/cn/java/j-lo-tomcat2/
tomcat从启动到为一个java web应用提供服务的过程非常复杂,我将上面的内容高度抽象成下五步,
- tomcat启动过程中, 创建web容器(Container)。
- 向Container添加web应用,创建servlet容器(servletContext),一个web应用就对应一个servlet容器,即一个servletContext对象。
- 初始化servletContext:包括解析tomcat配置(server.xml等)以及web应用程序配置(主要是web.xml),加载servlet class文件等。
- 根据web.xml文件,初始化其中的filter, servlet, listener等
- 启动http服务,响应客户端请求
4.2 servlet事件监听及spring容器加载
前面说了java web应用程序的启动过程,那么集成在java web中的spring容器又是如何加载的呢?
我们知道tomcat会使用观察者/广播订阅的设计模式来通知事件的发生,当一个servlet容器(即创建了servletContext对象)启动,即发生了一个servlet容器创建事件,
tomcat中的web容器会将这个事件通知给相应监听对象。
在4.1节的第4步中,servletContext对象将会根据web.xml配置创建listener对象,我们在第3节中在web.xml配置了一个ContextLoaderListener监听器,
这是spring提供的一个监听器,servlet容器在初始化的时候会根据web.xml配置创建这样的监听器对象,这个监听器有什么作用呢?
查看这个监听器的源码如下,
public class ContextLoaderListener extends ContextLoader
implements ServletContextListener
{
...
public void contextInitialized(ServletContextEvent event)
{
initWebApplicationContext(event.getServletContext());
}
...
}
可见这个监听器实现了servlet包中的ServletContextListener接口,并重写其中的contextInitialized方法,
根据servlet技术描述,servlet中的ServletContextListener实现类的实例可以监听servlet容器的启动(即创建servletContext对象)事件,并回调contextInitialized方法。
也就是说当上面的java web应用启动之后,将会通知spring的这个监听类对象,并回调被spring监听类重写的contextInitialized方法,
而在这个由spring监听器重写的回调方法中,进行了spring容器的初始化!即创建spring容器对象WebApplicationContext,并将此对象保存在servlet容器(即servletContext对象)中。
至此,java web容器完成了所有初始化工作,同时加载了spring容器,可以在web应用中直接使用注册在spring中的bean了,
上面过程比较复杂,下面再简要总结一下java web应用加载spring容器的过程,
- servlet容器创建spring listener对象
- web容器发出servlet容器启动成功的通知,spring的listener对象监听到事件
- spring的listener对象进行spring容器的初始化,并将spring容器保存进servlet容器中
- servlet容器加载了spring容器,此时可以直接在servlet实例中使用spring容器中的bean了
4.3 直接在jsp中测试spring和java web的集成
当我们完成了java web应用于spring的集成配置之后,就可以进行简单的测试了,我们可以直接在jsp中通过WebApplicationContextUtils获取spring容器对象,
index.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@page import="org.springframework.web.context.WebApplicationContext" %>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%@page import="test.TestBean" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>Hello World</h1>
<%
WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
TestBean tb = (TestBean) ctx.getBean("testBean");
out.println("<h1>"+tb.getName()+"</h1>");
tb.setName("lisi");
%>
</body>
</html>
关键代码,
<%
WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
TestBean tb = (TestBean) ctx.getBean("testBean");
out.println("<h1>"+tb.getName()+"</h1>");
tb.setName("lisi");
%>
执行结果,可以看我们并没有显式地初始化spring容器,而是用工具WebApplicationContextUtils(本质上是获取由servlet容器初始化的spring容器)到了spring容器对象,将spring容器中的testBean的属性打印出来了,
到这里,spring框架就整合到了java web项目中,下一步是要整合Hibernate框架。
三、搭建Hibernate环境
首先也是导入Hibernat的必要jar包,以及Hibernate提供的一些第三方工具包(例如数据池C3P0和二级缓存ehcache),
Java Web项目实战第1篇之环境搭建的更多相关文章
- Java Web开发SpringMVC和MyBatis框架开发环境搭建和简单有用
1.下载SpringMVC框架架包,下载地址: 点击下载 点击打开地址如图所看到的.点击下载就可以 然后把相关的jar拷贝到lib下导入 2.MyBatis(3.4.2)下载 X-Amz-Algori ...
- 项目构建之maven篇:1.环境搭建
maven下载: 下载地址 环境变量设置 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd29iZW5kaWFua3Vu/font/5a6L5L2T/fon ...
- step2-------使用myeclipse创建maven java web项目
1.文章内容概述: 在对项目需求进行分析之后,决定使用maven对我的java web项目进行管理,这篇文章记录了使用myeclipse创建maven java web项目的过程. 2.开发环境: j ...
- 在腾讯云服务器上实现java web项目部署
----------------------------博主讲废话 几天前搞了一台体验七天的腾讯云服务器.之前已实现在新浪云下java web项目的部署,不需要自己搭建环境,比较简单,而且自 己也偷懒 ...
- Linux CentOS下部署Java Web项目
本文讲解如何在Linux CentOS下部署Java Web项目的步骤. 一.环境准备: (1)Linux CentOS (2)apache-tomcat-9.0.10 (3)XShell 二.启动t ...
- 实战突击: Java Web项目整合开发(PDF)
实战突击: Java Web项目整合开发(PDF)
- 【java项目实战】一步步教你使用MyEclipse搭建java Web项目开发环境(一)
首先.在開始搭建MyEclipse的开发环境之前.还有三步工具的安装须要完毕,仅仅要在安装配置成功之后才干够进入以下的java Web项目开发环境的搭建. 1.安装工具 第一步,下载并安装JDK,到官 ...
- 阿里云部署Java web项目初体验(转)/linux 上配置jdk和安装tomcat
摘要:本文主要讲了如何在阿里云上安装JDK.Tomcat以及其配置过程.最后以一个实例来演示在阿里云上部署Java web项目. 一.准备工作 购买了阿里云的云解析,和云服务器ecs. 2.下载put ...
- 在MyEclipse下创建Java Web项目 入门(图文并茂)经典教程
http://jijiaa12345.iteye.com/blog/1739754 在MyEclipse下创建Java Web项目 入门(图文并茂)经典教程 本文是一篇在Myeclipse下构建Jav ...
随机推荐
- 在IIS上搭建WebSocket服务器(二)
服务器端代码编写 1.新建一个ASP.net Web MVC5项目 2.新建一个“一般处理程序” 3.Handler1.ashx代码如下: using System; using System.Col ...
- luogu 1045 麦森数
题目大意: 从文件中输入P(1000<P<3100000),计算2^P−1的位数和最后500位数字(用十进制高精度数表示) 思路: 一道高精度练习题 其中位数是一个结论 位数=[P*log ...
- JSP-Runoob:JSP 过滤器
ylbtech-JSP-Runoob:JSP 过滤器 1.返回顶部 1. JSP 过滤器 JSP 和 Servlet 中的过滤器都是 Java 类. 过滤器可以动态地拦截请求和响应,以变换或使用包含在 ...
- 单纯形&&线性规划
沦为了背板子...wyfcyx的ppt #include<bits/stdc++.h> using namespace std; ; , inf = 1e18; int n, m, l, ...
- openstack 虚拟机导出
- 基于spark和flink的电商数据分析项目
目录 业务需求 业务数据源 用户访问Session分析 Session聚合统计 Session分层抽样 Top10热门品类 Top10活跃Session 页面单跳转化率分析 各区域热门商品统计分析 广 ...
- Akka源码分析-Persistence
在学习akka过程中,我们了解了它的监督机制,会发现actor非常可靠,可以自动的恢复.但akka框架只会简单的创建新的actor,然后调用对应的生命周期函数,如果actor有状态需要回复,我们需要h ...
- A* 寻路算法[转载]
A* 寻路算法 转载地址:http://www.cppblog.com/christanxw/archive/2006/04/07/5126.html 原文地址: http://www.gamedev ...
- 自动保存草稿 asp+ajax自动存稿功能详解(转自影子)
自动保存草稿功能的原理 我们都知道网页是一种无状态的,每次都需要请求,响应,当一次请求完成后就与服务器断开连接了,所以我们不能像网页一样实现实时的交互功能,但是为了满足更多的需求一个比较无敌的程序员还 ...
- python gdal 修改shp文件的属性值
driver = ogr.GetDriverByName('ESRI Shapefile')datasource = driver.Open(shpFileName, 1)layer = dataso ...