jsp中服务器内部错误什么情况
这是错误:
HTTP Status 500 - An exception occurred processing JSP page /NewFile.jsp at line 19
--------------------------------------------
type Exception report
message An exception occurred processing JSP page /NewFile.jsp at line 19
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /NewFile.jsp at line 19
16: String s1="鲁迅浙江绍兴人。";
17: String s2="鲁迅浙江人。";
18:
19: n=SentenceSimilarity.last(s1,s2);
20: out.println(n);
21:
22: %>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handle
JspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.NullPointerException
hdu.edu.test.SentenceSimilarity.WordSim(SentenceSimilarity.java:23)
hdu.edu.test.SentenceSimilarity.last(SentenceSimilarity.java:204)
org.apache.jsp.NewFile_jsp._jspService(NewFile_jsp.java:82)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.30 logs.
--------------------------------------------
这是JSP代码:
<%@ page contentType="text/html;charset=gb2312" import="java.sql.*"%>
<%@page import="hdu.edu.test.*"%>
<html><body>
<div align="center">
<h2>您好,回答如下:</h2>
<%
double n;
String s1="鲁迅浙江绍兴人。";
String s2="鲁迅浙江人。";
n=SentenceSimilarity.last(s1,s2);
out.println(n);
%>
请问这怎么改?原JAVA文件时没问题的。
<br>
<br>
<div align="center"><a href="login.jsp"><font size=1>返回继续提问</font></a></div>
</div>
</body></html>
------解决方案-------------------- n=SentenceSimilarity.last(s1,s2);这行
空指针,这个类干嘛的?
------解决方案--------------------
hdu.edu.test.SentenceSimilarity