public void write(String content, String charset) {
getHttpResponse().setCharacterEncoding(charset);
getHttpResponse().setContentType("text/html;charset=" + charset);
try {
getHttpResponse().getWriter().print(content);
} catch (IOException e) {
e.printStackTrace();
}
}

  

	public String syncRes(){
if (**) {
write("操作成功", "UTF-8");
} catch (IOException e) {
e.printStackTrace();
write("操作失败:"+e.getMessage(), "UTF-8");
}else {
write("操作失败:没有传递正确的参数", "UTF-8");
}
return null;
}

  

function syncRes(){
if($("#indextemplet").val()==""){
alert("请选择页面模板");
selectTemplet($("#siteId").val());
return false;
}
if(confirm("此操作将把模板资源文件复制并覆盖到此站点,确认此操作么?")){ $.post("site_syncRes.do","site.id="+$("#siteId").val()+"&site.indextemplet="+$("#indextemplet").val(),syncResComplete,"text");
}
}
function syncResComplete(data){
alert(data);
}

  

随机推荐

  1. How to steal any developer's local database

    原文链接: http://bouk.co/blog/hacking-developers/ If you’re reading this and you’re a software developer ...

  2. 1003: [ZJOI2006]物流运输trans

    spfa+dp; 刚刚开始一直想不通怎么判断他是否换了道: 后来才知道,将那个时间段打包,找出这段时间内的最短路: 真是太奇妙了! #include<cstdio> #include< ...

  3. 【转】IO - 同步,异步,阻塞,非阻塞 (亡羊补牢篇)

    概念很重要,一定要掌握.实践都是基于它们的哟 ~~~~~~~~~~~~~~~~~ http://blog.csdn.net/historyasamirror/article/details/57783 ...

  4. 练习PYTHON之GEVENT

    这个只是作了第一个样例,里面还有很多高级的技巧,希望以后用得着. 我觉得因为以前看过几本LINUX内核,关于异步非阻塞IO,信号,锁之类的,所以理解起来,还可以. import gevent def ...

  5. SPRING IN ACTION 第4版笔记-第三章ADVANCING WIRING-008-SpEL介绍

    一. 1.SpEL expressions are framed with  #{ ... } 2.SpEl的作用 Sp EL has a lot of tricks up its sleeves, ...

  6. JSON对象与JSON数组

    一个对象以"{"(左括号)开始,"}"(右括号)结束.每个"名称"后跟一个":"(冒号):""名称/ ...

  7. c++模板注意事项

    c++模板类 分类: C++2012-08-20 21:28 7108人阅读 评论(2) 收藏 举报 c++编译器instantiationiostreamlinker编程 c++模板类 分类: 数据 ...

  8. 如何使用MIME类型

    今天在使用System.Net.WebClient做一个下载的时候,很郁闷,已经发不好的文件视频,却怎么也下载不了. 究其原因有两个, System.Net.WebClient对象的DownloadF ...

  9. 【CF】328 D. Super M

    这种图论题已经变得简单了... /* D */ #include <iostream> #include <string> #include <map> #incl ...

  10. 【HDOJ】1061 Rightmost Digit

    这道题目可以手工打表,也可以机器打表,千万不能暴力解,会TLE. #include <stdio.h> #define MAXNUM 1000000001 ][]; int main() ...