第7章 上机2

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>北大青鸟视频宣传片列表</title>
<style type="text/css">
.div1{
	height: 600px;
	width: 600px;
	background-color: #CCC;
}
.div2{float:left;
	height: 270px;
	width: 300px;
}

.x{
	height: 50px;
	width: 600px;
	background-repeat: repeat-x;
}
li{
	
	list-style-type: none;}
.z{background-image: url(icon-03.jpg);
	font-size: 36px;
	color: #FFF;
}
p{  text-indent:20px;
	background-image: url(icon-01.jpg);
	background-repeat: no-repeat;
}
span{
	text-indent:20px;
	background-image: url(icon-02.jpg);
	background-repeat: no-repeat;
	display: block;
}
</style>
</head>

<body>
<div class="x">
  
    <h1 class="z">精彩视频</h1>
  
</div>
<div class="div1">
<div class="div2">
<ul>
<li><a href="#"><img src="video-01.jpg"height="100px" width="240px"></a>
<h1>携手共同进步</h1>

  <p>时长:80秒</p>

  <span>点击:541563  </span>
</li>
</ul>
</div>
<div class="div2">
<ul>
<li><a href="#"><img src="video-02.jpg" height="100px" width="240px"></a>
<h1>美丽的起点</h1>
<p>时长:120秒</p>
<span>点击:657842   </span>
</li>
</ul>
</div>
<div class="div2">
<ul>
<li><a href="#"><img src="video-03.jpg"height="100px" width="240px"></a>
<h1>努力的过程</h1>
<p> 时长:50秒</p>
<span> 点击:912380    </span>
</li>
</ul>
</div>
<div class="div2">
<ul>
<li><a href="#"><img src="video-04.jpg"height="100px" width="240px"></a>
<h1>享受丰硕的成果</h1>
<p>时长:60秒</p>
<span>点击:47651280   </span>
</li>
</ul>
</div>
</div>


</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
下面是整合的的步骤 spring整合hibernate 加入jar包 加入spring和aop所需必须包 加入hibernate的必须包 spring整合hibernate的必须包 org.springframework.jdbc-3.1.3.RELEASE.jar org.springframework.orm-3.1.3.RELEASE.jar org.springframework.transaction-3.1.3.RELEASE.jar 加入配置文件 加入spring的配置文件 加入hibernate的配置文件 加入配置代码 加入对SessionFactory的配置 加入数据源(DataSource)的配置 <bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource"> <property name="driverClass" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/test"/> <property name="username" value="root"/> <property name="password" value=""/> </bean> 加入SessionFactory的配置 <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <!-- 配置session factory使用的数据源 --> <property name="dataSource" ref="dataSource" /> <!-- 配置使用hibernate的配置文件 --> <!--<property name="configLocation" value="classpath*:hibernate.cfg.xml" /> --> <!-- 无需写hibernate的配置文件,而是将hibernate的配置直接加入到spring配置文件中 配置hibernate的映射文件地址 --> <property name="mappingResources"> <list> <value>com/direct/domain/Employee.hbm.xml</value> <value>com/direct/domain/Log.hbm.xml</value> </list> </property> <!-- 配置hibernate的其他属性 --> <property name="hibernateProperties"> <map> <entry key="dialect" value="org.hibernate.dialect.MySQL5Dialect" /> <entry key="show_sql" value="true" /> <entry key="format_sql" value="true" /> <entry key="current_session_context_class" value="thread" /> </map> </property> </bean> 加入事务管理切面类的配置 <!-- 创建事务管理器(spring针对hibernate实现的事务管理的切面类) --> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- 事务的通知类型 --> <tx:advice id="transactionAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED"/> <tx:method name="update*" propagation="REQUIRED"/> <tx:method name="delete*" propagation="REQUIRED"/> <tx:method name="*" read-only="true" /> <!-- 或者 <tx:method name="*list*" read-only="true"/> <tx:method name="*get*" read-only="true"/> <tx:method name="*" propagation="REQUIRED"/> --> </tx:attributes> </tx:advice> 将切面类应用到切入点上 <!-- 将事务管理规则的切面应用到对应的切入点 --> <aop:config> <aop:pointcut expression="execution(* com.direct.service.*.*(..))" id="transactionPointCut"/> <aop:advisor advice-ref="transactionAdvice" pointcut-ref="transactionPointCut"/> </aop:config> spring和struts2的整合 加入整合包 加入struts的必须包 struts整合spring的包 struts2-spring-plugin-2.3.15.3.jar spring整合struts的包 org.springframework.web-3.1.3.RELEASE.jar org.springframework.web.servlet-3.1.3.RELEASE.jar org.springframework.web.struts-3.1.3.RELEASE.jar 加入struts的配置文件struts.xml 在web.xml中配置struts <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>/*</url-pattern> </filter-mapping> 在web.xml配置spring <!-- 配置spring的配置文件的位置 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:applicationContext-*.xml</param-value> </context-param> <!-- 配置spring随web容器启动时就创建 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> 在struts.xml中配置对象创建工具为spring <constant name="struts.objectFactory" value="spring" />
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值