--------------------------------- Js part -----------------------------
Function checkDbdl (){
Var bblx = document. getElementById ("bblx"). value;
Var basePath = document. getElementById ("basePath"). value;
Var dbdlxmlpath = document. getElementById ("dbdlxmlpath"). value;
Var bbdl = document. getElementById ("dbdl"). value;
$. Ajax ({
Url: basePath + 'readxmlaction _ getSmallTool. action', // The called action
Data: {'strxmlpath': dbdlxmlpath}, // Request Parameter
Success: function (msg ){
$ ("# Dbxl" cmd.html (oop + msg );
}
});
}
----------------------------- Java section ------------------------------
Package com. cs. webTool. action;
Import javax. servlet. http. HttpServletRequest;
Import javax. servlet. http. HttpServletResponse;
Import org. apache. struts2.ServletActionContext;
Import com. cs. webTool. util. ReadXml;
Import com. opensymphony. xwork2.ActionSupport;
Public class ReadXmlAction extends ActionSupport {
Public void readXml () throws Exception {
HttpServletRequest request = ServletActionContext. getRequest ();
HttpServletResponse res = ServletActionContext. getResponse ();
String strXmlPath = request. getParameter ("strXmlPath ");
Res. getWriter (). print (msg );
}
}
-------------------------- Struts configuration ---------------------------------
<Action name = "readXmlAction _ *" class = "com. cs. webTool. action. ReadXmlAction" method = "{1}">
</Action>