我在显示 servlet.service 异常 nosuch 方法异常或类的 jsp 页面中调用 java 方法
<%@page import="java.util.ArrayList"%>
<%@page import="Model.Validation"%>
<%
String username=request.getParameter("uname");
String password=request.getParameter("password");
System.out.print(username+"\nhellloo\n"+password+"\n re\n");
ArrayList<String> names=Validation.validateuname(username,password);
String name=(String)names.get(0);
String role=(String)names.get(1);
if(role.equals("Administrator"))
{
out.print("{success:true,errors:{reason:'Administrator'},uname:{name:'"+name+"'}}");
}else if(role.equals("User"))
{
out.print("{success:true,errors:{reason:'User'}}");
}else
{
out.print("{success:false,errors:{reason:'User name or Password is wrong, please try again'}}");
}
%>
严重:servlet jsp 的 Servlet.service() 抛出异常 java.lang.NoSuchMethodError: Model.Validation.validateuname(Ljava/lang/String;Ljava/lang/String;)Ljava/util/ArrayList; 在 org.apache.jsp.check_005flogin_jsp._jspService(check_005flogin_jsp.java:61) 在 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java :717) 在 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) 在 org.apache.jasper.servlet 的 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)。 JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache .