这是我的 Jquery Ajax 部分:-
$.ajax({
type: "GET",
data: 'name=' + dept+"&emp=1",
async: false,
url: "master/loginCreateUser.jsp/getEmpName()", //i m not able call thisgetEmpName Function call in this location
success: function(data) {
for(var item in data){
$("#empName").append("<option>" + data[item] + "</option>");
}
}
});
这是我的 loginCreateUser.jsp 页面:
<%!
public ArrayList<String> getEmpName() throws Exception {
ArrayList<String> emp = new ArrayList(); %>
<% String s1 = request.getParameter("name"); %>
<%! emp = new UserRights().showEmp(s1); %> //i am not access this s1 variable on this location,it shows the error can't find symbol"
<%
return emp;
}
%>
如何从jsp
页面调用此函数?