基于Java-ssm框架和Eclipse开发工具的旅游管理网站(产品管理页面)

页面介绍

旅游管理系统基于JavaSSM框架,Maven,Mysql数据库,Bootstrap动态页面,springMVC,mybatis等,其中产品管理页面有增删改查,动态显示,分页显示,多行删除的功能。

后台代码

依赖安装(pom.xml)

pom.xml文件pom.xml作为Maven架构中用于管理:源代码、配置文件、开发者的信息和角色、问题追踪系统、组织信息、项目授权、项目的url、项目的依赖关系的文件。十分重要,首先要在pom文件中把项目所要用到的相关依赖插件安装。

项目资源配置(resource)

java项目资源配置文件夹

applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
	http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans.xsd
	http://www.springframework.org/schema/mvc
	http://www.springframework.org/schema/mvc/spring-mvc.xsd
	http://www.springframework.org/schema/context
	http://www.springframework.org/schema/context/spring-context.xsd
	http://www.springframework.org/schema/aop
	http://www.springframework.org/schema/aop/spring-aop.xsd">

	<!-- 开启注解扫描,管理service和dao -->
	<context:component-scan
		base-package="com.yzw.service">
	</context:component-scan>
	<context:component-scan
		base-package="com.yzw.dao">
	</context:component-scan>
	
	<context:property-placeholder location="classpath:db.properties" />
		<!-- 配置数据库数据源 -->
		<bean id="dataSource"
			class="com.mchange.v2.c3p0.ComboPooledDataSource">
			<property name="driverClass" value="${jdbc.driver}" />
			<property name="jdbcUrl" value="${jdbc.url}" />
			<property name="user" value="${jdbc.username}" />
			<property name="password" value="${jdbc.password}" />
		</bean>
		
		<!-- 创建spring工厂 -->
		<bean id="sqlSessionFactory"
			class="org.mybatis.spring.SqlSessionFactoryBean">
			<property name="dataSource" ref="dataSource" />
			
			<!-- 传入PageHelper的插件 -->
			<property name="plugins">
				<array>
					<!-- 传入插件的对象 -->
					<bean class="com.github.pagehelper.PageInterceptor">
						<property name="properties">
							<props>
								<prop key="helperDialect">mysql</prop>
								<prop key="reasonable">true</prop>
							</props>
						</property>
					</bean>
				</array>
			</property>
		</bean>
		
		<!-- 扫描dao/mapper接口文件 -->
		<bean id="mapperScanner"
			class="org.mybatis.spring.mapper.MapperScannerConfigurer">
			<property name="basePackage" value="com.yzw.dao" />
			<!-- 如果还有有些专门针对于mybatis的配置,需要引入 -->
		</bean>
		
		
</beans>

该文件用于配置数据源和过滤扫描器

db.properties

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/pms?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&rewriteBatchedStatements=true
jdbc.username=root
jdbc.password=12345678

## P6SpyDriver
jdbc.driver=com.p6spy.engine.spy.P6SpyDriver
jdbc.url=jdbc:p6spy:mysql://localhost:3306/pms?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&rewriteBatchedStatements=true
jdbc.username=root
jdbc.password=12345678

该文件用于连接mysql数据库

log4j.properties

### 设置###
log4j.rootLogger = debug,stdout,D,E

### 输出信息到控制台 ###
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target = System.out
log4j.appender.stdout.layout 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值