前端访问:/Apply/apply/Step1Save ,一直访问不到争取的方法。
每次请求都发到/Apply/apply/index,以为是拦截器的问题,但是加了@Clear,还是访问到index。
求解
前端代码:
$('#submit').click(function() { var form = new FormData(document.getElementById("msform")); console.log(">>>>>>>>>"+form.get("applyName")); console.log(">>>>>>>>>"+form.get("name")); $.ajax({ url:"/Apply/apply/step1Save", type:"post", dataType: "json", data:form, processData:false, contentType:false, async: false, cache: false, success:function(data){ var object=eval(data); var rst=eval(object.result); console.log("登录结果:"+rst.code); }, error:function(e){ alert("登录失败!"); console.log("over..Fail"+e); } }); });
后台代码:
@LeeAction("/apply") public class ApplyStep1Controller extends Controller { private DynamicMsgService msgService=new DynamicMsgService(); private ApplyService applyService=new ApplyService(); /** * 跳转申请信息页面 */ @Clear public void index() { render("apply.html"); } @Clear public void step1Save() { List<UploadFile> list =getFiles(); // UploadFile f=getFile(); String name = getPara("applyName"); String idno = getPara("applyIdNo"); String phone = getPara("phone"); String scope = getPara("servScope"); // <OPTION VALUE="1">水电工 </OPTION> 。。。。。。。。。。 }
项目:JFinal