如何在行动中调用ajax [英] how to call ajax in action

查看:104
本文介绍了如何在行动中调用ajax的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

公共ActionForward选择(ActionMapping映射,ActionForm表单,

HttpServletRequest请求,HttpServletResponse响应)

抛出异常{

StudentForm form2 =( StudentForm)表格;

// form2.setStudentName(\"santosh);

字符串值= form2.getStudentName();

try {

response.getWriter()。write(value);

} catch(IOException e){

e.printStackTrace();

// TODO:处理异常

}

返回null;

}

public ActionForward select(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
StudentForm form2=(StudentForm)form;
//form2.setStudentName("santosh");
String value=form2.getStudentName();
try{
response.getWriter().write(value);
}catch (IOException e) {
e.printStackTrace();
// TODO: handle exception
}
return null ;
}

推荐答案

公共ActionForward选择(ActionMapping映射,ActionForm表单,

HttpServletRequest请求,HttpServletResponse响应)

抛出异常{

StudentForm form2 =(StudentForm)表格;

// form2.setStudentName(\"santosh);

字符串值= form2.getStudentName();

尝试{

response.getWriter()。write(value);

} catch(IOException e){

e.printStackTrace();

// TODO:处理异常

}

返回null;

}
public ActionForward select(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
StudentForm form2=(StudentForm)form;
//form2.setStudentName("santosh");
String value=form2.getStudentName();
try{
response.getWriter().write(value);
}catch (IOException e) {
e.printStackTrace();
// TODO: handle exception
}
return null ;
}


这篇关于如何在行动中调用ajax的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆