20100921

1、

  var oStartDate = document.getElementById("accRecordVO.staDate").value
   var pat_hd=/^20\d{2}-((0[1-9]{1})|(1[0-2]{1}))-((0[1-9]{1})|([1-2]{1}[0-9]{1})|(3[0-1]{1}))$/;
    //对日期格式进行验证 要求为2000-2099年  格式为 yyyy-mm-dd 并且可以正常转换成正确的日期

   if(oStartDate!=""){
    if(!pat_hd.test(oStartDate)){
       alert("日期非法!格式如2010-03-24");
    return false;
       }

 


    var arr_hd=oStartDate.split("-");
    var dateTmp;
    dateTmp= new Date(arr_hd[0],parseFloat(arr_hd[1])-1,parseFloat(arr_hd[2]));
    if(dateTmp.getFullYear()!=parseFloat(arr_hd[0]) || dateTmp.getMonth()!=parseFloat(arr_hd[1]) -1 || dateTmp.getDate()!=parseFloat(arr_hd[2]))
    {
    alert("日期非法!格式如2010-03-24");
   return false;
    }
 }

 

2、<s:label value="用户名">
       <s:textfield name="accRecordVO.userName"></s:textfield>
      </s:label>

 

<jscalendar:jscalendar name="accRecordVO.staDate" id="accRecordVO.staDate" format="%Y-%m-%d" showstime="true"/>

 

3、<s:form namespace="/admin/accRecord" action="showAccTechList" validate="true" method="post">

 

<form id="loginForm"    action="${pageContext.request.contextPath}/admin/user/login.action">

 

 

4、<result name="success" type="redirect">
    /admin/index.action
   </result>

 

5、<select id="login" parameterClass="com.launch.ncp.model.User"
  resultMap="user">
  <![CDATA[
   select * from T_manager_user where user_name = #userName# and password =#password#
  ]]>
 </select>

 

<resultMap id="user" class="com.launch.ncp.model.User">
  <result property="userId" column="user_id" />
  <result property="userName" column="user_name" />
  <result property="telephone" column="telephone" />
  <result property="mobile" column="mobile" />
  <result property="password" column="password" />
  <result property="userStatus" column="USER_STATUS" />
  <result property="gender" column="GENDER" />
  <result property="email" column="email" />
  <result property="department" column="department" />
  <result property="description" column="DESCRIPTION" />
 </resultMap>

 

return (User) getSqlMapClientTemplate().queryForObject("UserSQL.login",
    user);

 

 

6、

<bean id="carTechnologyDao"
  class="com.launch.ncp.dao.ibatis.CarTechnologyDaoiBatis">
  <property name="sqlMapClient" ref="sqlMapClient" />
 </bean>

 

<bean id="sqlMapClient"
  class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
  <property name="configLocation">
   <value>classpath:sqlmap-config.xml</value>
  </property>
  <property name="dataSource" ref="dataSource" />
  <property name="lobHandler" ref="lobHandler"></property>
 </bean>

 

7、

   <bean id="carTechnologyManager" parent="txProxyTemplate">
      <property name="target">
       <ref bean="carTechnologyManagerTarget"/>
      </property>
     </bean>

8、

 <bean id="txProxyTemplate" abstract="true"
        class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        <property name="transactionManager" ref="transactionManager"/>
        <property name="transactionAttributes">
            <props>
                <prop key="create*">PROPAGATION_REQUIRED</prop>
                <prop key="remove*">PROPAGATION_REQUIRED</prop>
                <prop key="delete*">PROPAGATION_REQUIRED</prop>
              
                <prop key="update*">PROPAGATION_REQUIRED</prop>
                <prop key="save*">PROPAGATION_REQUIRED</prop>
                <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
               
            </props>
        </property>
    </bean>

 

<bean id="transactionManager"
  class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource">
   <ref local="dataSource" />
  </property>
 </bean>

 

 

9、prototype 属性使您有能力向对象添加属性和方法。

 

你可能感兴趣的:(DAO,bean,ibatis,prototype,mobile)