- 浏览: 30843 次
- 性别:
- 来自: 天津
-
最新评论
-
coderlu:
后边接or的时候,该怎么处理呢?
拼写sql语句的小技巧 -
lzy_clement:
fjc04091125 写道用jquery中的json不是更简 ...
jquery-ajax -
fjc04091125:
用jquery中的json不是更简单
jquery-ajax
文章列表
struts2.x 在web.xml配置中有两个核心过滤器
FilterDispather :旧版本的过滤器,用此过滤器,当我们自定义过滤器时,要放在struts2.x的过滤器前,
若放在struts2.x的过滤器后,则自定义过滤器作废.
e.g:若必须使用Action,但想在Action前用filter做某些过滤功能,则无法成功,
因为使用Action必须先经过struts的过滤器.
StrutsPrepareAndExecuteFilter:可拆分为strutsPrepareFilter和StrutsExecuteF ...
用js函数提供一个判断字符串是否数字的函数: isNaN("字符串")
在前台页面中,若想比较日期大小,只能自己手动转换,
var dtArr = ($("2008-12-12']").val()).split("-");
var startDate=new Date(dtArr[0], dtArr[1], dtArr[2]);
startDate.setMonth(startDate.getMonth()-1);
在页面中想得到当前时间,通过js var date = new Dat ...
当用json数据从后台传到前台时,日期格式将会转换,若直接输入会得出一个让人不理解的值,若想变成中国格式的日期,可自己拼写字符串,
json[0].planStartDate.year+1900
)+"-"+(json[0].planStartDate.month+1
)+"-"+(json[0].planStartDate.date
)
获取回来的日期,年加上1900,月加上1,日期不用变
在div中加上一个class="tabs"的样式,会给背景加上一个背景
通常class=tabs与class=tabsContent是成对出现的.
rel代表在所在的id中作添加.
eg: 有一个a标签
<a href='transit/departments_list.action?OID="+json[i].OID+"' target='ajax' rel='listDepartment'>
a标签作一个struts2的请求.当请 ...
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>struts-defaul ...
spring中自带的字符编码转换
- 博客分类:
- spring
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value&g ...
在程序中自己拼写sql语句时,当有条件的时候,得加上where条件.
但是当多个条件,而且在拼写前并不确定是否有条件,
若每个都判断前面所拼写的sql语句是否有where,或者是否有and时,会相对比较麻烦.
可以在拼写前减少这种判断.
select * from 表名 where 1=1
接着在此基础上往后拼写,当有条件时,拼 and 条件名=条件.
$.ajax({
type : 'post',
url : 'transit/databackup_update.action',
dataType : 'text',
data : $('form:first').serialize(),
success :alert("设置成功!"),
error : function (xml, err) {alert("设置错误!请重试...");} });
其中$('form:first').s ...
利用Timer类创建出一个对象,其中有schedule()方法制定任务要执行的时间间隔,精确时间等.
(delay:程序开启后多长时间运行任务60*1000=1分钟
period:任务执行的间隔时间)
schedule方法里有一个Task任务,所执行的方法均在一个类中,此类必须继承TimerTask类
backup database "数据库名" to disk='E:\\MyDatabase.bak
当spring配置文件不在默认目录下时(具体好像是src目录下),当用ApplicationContext在配置文件中取值,就不能采用ClassPathXMLApplicationContext来取bean的值,只能用FileSystemXmlApplicationContext来读取
ApplicationContext ctx=new FileSystemXmlApplicationContext("全路径");
全路径:"WebRoot/WEB-INF/context/applicationContext.xml"
...
$("tr>td").css("text-align","left");
$(function(){
$("#mytable > tbody").find("tr").each(function(){
$(this).find("td:first-child").css("text-align","right");
$(this).find("td:eq(1) ...
<style type="text/css">
.div {
position:absolute;
top:50%;
left:50%;
margin:-180px 0 0 -240px;
width:480px;
height:300px;
}
.fie{
width:460px;
height:280px;
border: #C0C0C0 solid 1px;
}
td{
height:20px;
}
</style> ...