1.h3:
id生成策略:<generator class="sequence"><param name="sequence">SEQ_T_WARNVALUEI_INFO2.
============================================================================================
2.<!-- 激活spring的注解. -->
<context:annotation-config />
<context:component-scan base-package="com.jiankong..*,com.ctid..*">
<context:include-filter type="annotation" expression="org.aspectj.lang.annotation.Aspect" />
</context:component-scan>
============================================================================================
<!-- spring监控任务定时配置 -->
<bean id="quartzDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="monitorSysInfoQuart" />
</property>
<property name="targetMethod">
<value>toWritemassage</value>
</property>
</bean>
<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="quartzDetail" />
<property name="startDelay" value="3000" /><!-- 调度工厂实例化后,经过5秒开始执行调度 -->
<property name="repeatInterval" value="3000" /><!-- 每300秒调度一次 -->
</bean>
<bean autowire="no"class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local="simpleTrigger" />
</list>
</property>
</bean>
===============================================================================================
3.web.xml中
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:/com/config/spring/*.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
=========================================================================================
<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>
=================================================================================================
jsp中:
1:<fmt:formatNumber value="${cpuUsage}" type="percent" maxFractionDigits="2"/> 百分数显示
2:<input type="checkbox" disabled="true" value="chooseMessage" <s:if test='chooseMessage==1'>checked</s:if> /> 选中,不能操作
<s:if test='chooseMessage=="1"'>
<s:checkbox name="chooseMessage" fieldValue="1"checked="checked" />
</s:if> <s:else>
<s:checkbox name="chooseMessage" fieldValue="1"class="cbox"/>
</s:else>
input的checked可以用,但是s:checkbox不可以。
3. οnblur="checkperc(this)" 参数传递this
function checkPerc(obj) {
if(obj.value.trim() == ""){
alert("使用率不能为空");
obj.focus();
return;
}
var regExp = /^((\d+\.?\d*)|(\d*\.\d+))\$/g;
result = regExp.test(obj.value);
if (!result) {
alert("请输入0-1之间的数字");
obj.focus();
return;
}
if(obj.value.trim()<0 || obj.value.trim()>1){
alert("请输入0-1之间的数字");
obj.focus();
return;
}
}
var telReg = !!tel.match(/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/);
//如果手机号码不能通过验证
if(telReg == false){
alert("手机号格式不正确");
obj.focus();
}
==================================================
1:<s:fielderror ></s:fielderror><s:actionerror/>