java网站建设5-框架搭建

转载:http://www.verydemo.com/demo_c143_i2786.html

        经过这几天对spring的研究,终于用spring框架搭建好项目了,用的是 spring mvc,spring依赖注入,spring dao。

用到的包有:

web.xml配置如下?:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">

	<display-name>sss</display-name>
	<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>
	<servlet>
		<servlet-name>spring</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>spring</servlet-name>
		<url-pattern>*.do</url-pattern>
	</servlet-mapping>
	<welcome-file-list>
		<welcome-file>pages/web/index.jsp</welcome-file>
	</welcome-file-list>
</web-app>

....................................................................

下一步的任务是封装基类,action,dao甚至service的。

这个项目主要是锻炼下自己,把学到的知识贯穿下。

猜你喜欢

转载自xieshuai19887893.iteye.com/blog/2073331