如何在行动中调用ajax [英] how to call ajax in action
问题描述
公共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屋!