spring 配制与表单显示

1、spring.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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd ">

<!-- 配置sqlSessionFactory -->
<bean id="sqlSessionFactory_msp" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="configLocation" value="classpath:mybatis_config/mybatis-config-msp.xml"></property>
<property name="dataSource" ref="dataSource_msp" />
</bean>

<bean id="sqlSessionTemplate_msp" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg ref="sqlSessionFactory_msp" />
</bean>

<!-- spring管理事务 -->
<bean id="txManager_msp"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource_msp" />
</bean>

<!-- Spring的声明式事务管理 -->
<!-- 设置与事务有关的各种属性 -->
<tx:advice id="txAdvice_msp" transaction-manager="txManager_msp">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="insert*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="del*" propagation="REQUIRED" />
<tx:method name="remove*" propagation="REQUIRED" />
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice>

<!-- 声明切入点 -->
<aop:config>
<aop:pointcut id="interceptorPointCuts_msp"
expression="execution(* com.hcresearch.msp.*.service.*.*(..))" />
<aop:advisor advice-ref="txAdvice_msp" pointcut-ref="interceptorPointCuts_msp" />
</aop:config>

<!-- 通过扫描的模式,自动注入bean -->
<bean id="mapperScannerConfigurer_msp" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage"
value="com.hcresearch.msp.*.mapper"></property>
<property name="sqlSessionTemplate" ref="sqlSessionTemplate_msp"></property>
<property name="sqlSessionFactory" ref="sqlSessionFactory_msp"></property>
</bean>
</beans>
2、表单显示

<form id="userForm" name="userForm" target="_blank" action="quickReg" namespace="/" theme="simple">
<!-- <div class="wrong"><span class="tishi" id="errorInfo"></span><span><a style="cursor:hand "><img src="use_img/wrong.jpg" style="margin-top:5px;" οnclick="window.parent.displayquickreg()" /></a></span></div>-->
<div class="wrong"><span class="tishi" id="errorInfo"></span><span style="float:right; margin-right:4px;"><a style="cursor:hand " οnclick="displayquickreg_1()"><img src="use_img/wrong.jpg" style="margin-top:5px;" /></a></span></div>

<div class="textvalue">

游戏账号 <input type="text" name="user.userName" id="userid" οnblur="userValidate()"/>
<br />游戏密码 <input type="password" name="user.pwd" id="pwd1"οnblur="pwdFirValidate()" />
<br />确认密码 <input type="password" name="pwdsure" id="pwd2" οnblur="pwd2Validate()"/>
<br />真实姓名 <input type="text" name="textfield" id="realNameId" οnblur="validateRealName1()" name="user.realName" />
<br />身份证号 <input type="text" name="user.identifyNo" id="identifyNum" οnchange="identifyValidate1()" />
<br />验证码<input type="text" name="str" style="width:55px; margin-right:5px;margin-left:20px; " /><img src="rand.action" width="56px" height="24px" align="absmiddle" id="randImg" οnclick="changeValidateCode(this)" alt="看不清楚?点击刷新"/>
<br />
<input style="background:none; border:none;color:#FFFFFF; width:10px;" type="checkbox" id ="chen" checked ="true" name="Checkbox1" /><a href="http://passport.xkyx.com/usercenter/description/treaty.jsp" target="_blank">同意并接受服务协议和隐私声明</a>
<br />
<label>
<div style="width:57px; height:26px; background:none; border:none; margin-left:50px;"><img οnclick="totalValidate1()" src="use_img/qd.jpg" alt="" /></div>
</label>

</div>

</form>

<%@taglib prefix="s" uri="/struts-tags" %>
<div class="suc">
<div > <s:property value="message"/> </div>

</div>
</div>

<jsp:include page="/template/foot.html" flush="true"/>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值