关于网友提出的“ service 代码转struts2 代码写法请大家指教!”问题疑问,本网通过在网上对“ service 代码转struts2 代码写法请大家指教!”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: service 代码转struts2 代码写法请大家指教!
描述: $.get("manage.do?t="+new Date().valueOf(),{
"action":"updateUser",
"id":idas
},function(data){
if(data =="success"){
alert("修改成功!");
window.location.reload();
}else if(data =="failed"){
alert("修改失败!");
}
});
service 写法
public void programaAdd(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
String data = "";
String title = request.getParameter("id");
Date time = new Date(now.getTime());
NoticeInfo notice = new NoticeInfo();
notice.setTitle(title);
Integer newP = this.programas.ProgramaAdd(notice);
if (newP > 0) {
data = "success";
} else {
data = "failed";
}
out.print(data);
out.flush();
out.close();
}
------------------------------------
把上面的代码转换为有SSH 框架里面怎么写呢?
以上介绍了“ service 代码转struts2 代码写法请大家指教!”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/2954740.html