要添加org.springframework.web-3.x.x.RELEASE.jar
ServletContext application; WebApplicationContext wac; application = getServletContext(); wac = WebApplicationContextUtils.getWebApplicationContext(application); wac.getBean("...");
Learn and share.
要添加org.springframework.web-3.x.x.RELEASE.jar
ServletContext application; WebApplicationContext wac; application = getServletContext(); wac = WebApplicationContextUtils.getWebApplicationContext(application); wac.getBean("...");
//type=1 全选 //type=2 全不选 //type=3 反选 function selectAll(form, type) { var elems = form.elements; for ( var i = 0 ; i < elems.length ; i++ ) { var e = elems[i]; if(e.type == 'checkbox') { switch(iType) { case 1: e.checked = true; break; case 2: e.checked = false; break; case 3: e.checked = !(e.checked); break; } } } } function checkAll() { var elems=document.getElementsByTagName( "INPUT "); for(i=0;i<elems.length;i++) { var e = elems[i]; if(e.type.toLowerCase()== "checkbox ")e.checked=true; } }
function SubmitMyForm(url) { document.myForm.action = url; document.myForm.submit(); }
$(function() { var ctrl = document.getElementById("mainframe"); var $div_li = $("div.div_header ul li"); $div_li.click(function() { var index = $div_li.index(this); if (index != 4){ $("li.selected").removeClass( "selected" ); $(this).addClass("selected"); } if (index == 0) {ctrl.src = "";} else if (index == 1) {ctrl.src = "";} else if (index == 2) {ctrl.src = "";} else if (index == 3) {ctrl.src = "";} else if (index == 4) {window.location.href = "logout.jsp";} }).hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); }); });
var titleheight=30; $(document).ready(function() { var ctrl = document.getElementById("iframeid"); ctrl.height = document.body.clientHeight - titleheight; ctrl.width = document.body.clientWidth; });
alert("你好"); if(confirm(你现在快乐吗?)){ alert("真为你高兴"); } else { alert("没关系,都会好起来的,对自己好一些"); } var m=window.prompt("你今年几岁了啊"); alert("你今年"+m+"岁了");
function openNewWnd(url,title) { newwindow = window.open(url, title, 'toolbar=no,menubar=no, scrollbars=no, width=500,height=200'); newwindow.focus(); return false; }
//id,颜色a,颜色b function DColorTable(tid, colora, colorb) { var ctrl = document.getElementById(tid); if(ctrl==null)return; var trs = ctrl.getElementsByTagName("tr"); for ( var i = 0; i < trs.length; i++) { trs[i].style.backgroundColor = (trs[i].sectionRowIndex % 2 == 0) ? colora : colorb; } } DColorTable("dcolorTable","#FFFFFF","#c6e1fd");
//返回当前页面高度 function pageHeight(){ if($.browser.msie){ return document.compatMode == "CSS1Compat"? document.documentElement.clientHeight : document.body.clientHeight; }else{ return self.innerHeight; } }; //返回当前页面宽度 function pageWidth(){ if($.browser.msie){ return document.compatMode == "CSS1Compat"? document.documentElement.clientWidth : document.body.clientWidth; }else{ return self.innerWidth; } };
Chain:
Action响应链,用于多个Action处理一次请求,
后面的Action可以访问前面的Action,不要过度使用
Dispatcher:
网络资源整合,如返回JSP页面,默认
FreeMarker:
用于FreeMarker整合
HttpHeader:
控制特定的HTTP行为
Redirect:
重定向到网络资源
Redirect Action:
重定向到另一个Action映射
Stream:
用于向浏览器提供输入流,一般用于文件下载
Velocity:
用于Velocity整合
XSL:
用于XML/XSLT整合
PlainText:
用于显示页面的原始内容
Tiles:
用于Tiles整合