其他的JSP是可以运行的
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NullPointerException
org.apache.jsp.login_jsp._jspService(org.apache.jsp.login_jsp:48)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
8 个解决方案
#1
500是服务器实时运行错
java.lang.NullPointerException
org.apache.jsp.login_jsp._jspService(org.apache.jsp.login_jsp:48)
说的是你的login.jsp转成的servlet文件(work下)org.apache.jsp.login_jsp.java的48行有一个空引用被操作了
java.lang.NullPointerException
org.apache.jsp.login_jsp._jspService(org.apache.jsp.login_jsp:48)
说的是你的login.jsp转成的servlet文件(work下)org.apache.jsp.login_jsp.java的48行有一个空引用被操作了
#2
好象没有看到NULL引用啊 代码如下
<%@ page language="java" contentType="text/html; charset=gb2312"%>
<%String UserName = "", UserEMail = "",LoginDate = "";
Cookie temp = null;
Cookie[] cookies = request.getCookies();
int cookielen = cookies.length;
for(int i= 0;i<cookielen;i++){
temp = cookies[i];
if(temp.getName().equals("Name")){
UserName = temp.getValue();
}
else if(temp.getName().equals("E_Mail")){
UserEMail = temp.getValue();
}
else if (temp.getName().equals("LoginDate")){
LoginDate = temp.getValue();
}
}
int tmplen = LoginDate.length();
boolean FirstLogin;
if(tmplen != 0){
FirstLogin = false;
}
else{
FirstLogin = true;
}
%>
<html>
<head>
<title>Cooke???????</title>
</head>
<body>
<CENTER>
<FONT SIZE = 5 COLOR = BLUE>Cooke???????</FONT>
</CENTER>
<HR>
<BR>
<%
if(FirstLogin == true){
%>
????????????????E-mail??
<%
}
else{
%>
??????????????
<font size = 4 color = red ><%= LoginDate %></font>
<%
}
%>
<form action = "settime.jsp" method =post name = form>
<P> ??:<INPUT name = tmpName value = "<%=UserName%>"></p>
<p>E-Mail:<INPUT name = tmpE_mail value ="<%=UserEMail%>"></p>
<input name = submit type = submit value = ??>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=gb2312"%>
<%String UserName = "", UserEMail = "",LoginDate = "";
Cookie temp = null;
Cookie[] cookies = request.getCookies();
int cookielen = cookies.length;
for(int i= 0;i<cookielen;i++){
temp = cookies[i];
if(temp.getName().equals("Name")){
UserName = temp.getValue();
}
else if(temp.getName().equals("E_Mail")){
UserEMail = temp.getValue();
}
else if (temp.getName().equals("LoginDate")){
LoginDate = temp.getValue();
}
}
int tmplen = LoginDate.length();
boolean FirstLogin;
if(tmplen != 0){
FirstLogin = false;
}
else{
FirstLogin = true;
}
%>
<html>
<head>
<title>Cooke???????</title>
</head>
<body>
<CENTER>
<FONT SIZE = 5 COLOR = BLUE>Cooke???????</FONT>
</CENTER>
<HR>
<BR>
<%
if(FirstLogin == true){
%>
????????????????E-mail??
<%
}
else{
%>
??????????????
<font size = 4 color = red ><%= LoginDate %></font>
<%
}
%>
<form action = "settime.jsp" method =post name = form>
<P> ??:<INPUT name = tmpName value = "<%=UserName%>"></p>
<p>E-Mail:<INPUT name = tmpE_mail value ="<%=UserEMail%>"></p>
<input name = submit type = submit value = ??>
</body>
</html>
#3
到Tomcat下的Work文件夹下找login_jsp.java文件,第48行有问题
#4
不过我估计是下面这句的问题:
int cookielen = cookies.length;
cookies为空就取不到length
int cookielen = cookies.length;
cookies为空就取不到length
#5
那这个问题应该怎么解决啊
刚刚学JSP不会啊
刚刚学JSP不会啊
#6
加个判断啊,如果对象不为空才处理
#7
和我的問題一樣,但我的問題解決了,我可以看看你的代碼嗎?可能也是一些比如“<P> ??:<INPUT name = tmpName value = "<%=UserName%>"></p>
<p>E-Mail:<INPUT name = tmpE_mail value ="<%=UserEMail%>"></p>
里面的username和useremail 和你定義的是否一樣?你再看一下!
<p>E-Mail:<INPUT name = tmpE_mail value ="<%=UserEMail%>"></p>
里面的username和useremail 和你定義的是否一樣?你再看一下!
#8
代码在上面
我在好好看看
我在好好看看
#1
500是服务器实时运行错
java.lang.NullPointerException
org.apache.jsp.login_jsp._jspService(org.apache.jsp.login_jsp:48)
说的是你的login.jsp转成的servlet文件(work下)org.apache.jsp.login_jsp.java的48行有一个空引用被操作了
java.lang.NullPointerException
org.apache.jsp.login_jsp._jspService(org.apache.jsp.login_jsp:48)
说的是你的login.jsp转成的servlet文件(work下)org.apache.jsp.login_jsp.java的48行有一个空引用被操作了
#2
好象没有看到NULL引用啊 代码如下
<%@ page language="java" contentType="text/html; charset=gb2312"%>
<%String UserName = "", UserEMail = "",LoginDate = "";
Cookie temp = null;
Cookie[] cookies = request.getCookies();
int cookielen = cookies.length;
for(int i= 0;i<cookielen;i++){
temp = cookies[i];
if(temp.getName().equals("Name")){
UserName = temp.getValue();
}
else if(temp.getName().equals("E_Mail")){
UserEMail = temp.getValue();
}
else if (temp.getName().equals("LoginDate")){
LoginDate = temp.getValue();
}
}
int tmplen = LoginDate.length();
boolean FirstLogin;
if(tmplen != 0){
FirstLogin = false;
}
else{
FirstLogin = true;
}
%>
<html>
<head>
<title>Cooke???????</title>
</head>
<body>
<CENTER>
<FONT SIZE = 5 COLOR = BLUE>Cooke???????</FONT>
</CENTER>
<HR>
<BR>
<%
if(FirstLogin == true){
%>
????????????????E-mail??
<%
}
else{
%>
??????????????
<font size = 4 color = red ><%= LoginDate %></font>
<%
}
%>
<form action = "settime.jsp" method =post name = form>
<P> ??:<INPUT name = tmpName value = "<%=UserName%>"></p>
<p>E-Mail:<INPUT name = tmpE_mail value ="<%=UserEMail%>"></p>
<input name = submit type = submit value = ??>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=gb2312"%>
<%String UserName = "", UserEMail = "",LoginDate = "";
Cookie temp = null;
Cookie[] cookies = request.getCookies();
int cookielen = cookies.length;
for(int i= 0;i<cookielen;i++){
temp = cookies[i];
if(temp.getName().equals("Name")){
UserName = temp.getValue();
}
else if(temp.getName().equals("E_Mail")){
UserEMail = temp.getValue();
}
else if (temp.getName().equals("LoginDate")){
LoginDate = temp.getValue();
}
}
int tmplen = LoginDate.length();
boolean FirstLogin;
if(tmplen != 0){
FirstLogin = false;
}
else{
FirstLogin = true;
}
%>
<html>
<head>
<title>Cooke???????</title>
</head>
<body>
<CENTER>
<FONT SIZE = 5 COLOR = BLUE>Cooke???????</FONT>
</CENTER>
<HR>
<BR>
<%
if(FirstLogin == true){
%>
????????????????E-mail??
<%
}
else{
%>
??????????????
<font size = 4 color = red ><%= LoginDate %></font>
<%
}
%>
<form action = "settime.jsp" method =post name = form>
<P> ??:<INPUT name = tmpName value = "<%=UserName%>"></p>
<p>E-Mail:<INPUT name = tmpE_mail value ="<%=UserEMail%>"></p>
<input name = submit type = submit value = ??>
</body>
</html>
#3
到Tomcat下的Work文件夹下找login_jsp.java文件,第48行有问题
#4
不过我估计是下面这句的问题:
int cookielen = cookies.length;
cookies为空就取不到length
int cookielen = cookies.length;
cookies为空就取不到length
#5
那这个问题应该怎么解决啊
刚刚学JSP不会啊
刚刚学JSP不会啊
#6
加个判断啊,如果对象不为空才处理
#7
和我的問題一樣,但我的問題解決了,我可以看看你的代碼嗎?可能也是一些比如“<P> ??:<INPUT name = tmpName value = "<%=UserName%>"></p>
<p>E-Mail:<INPUT name = tmpE_mail value ="<%=UserEMail%>"></p>
里面的username和useremail 和你定義的是否一樣?你再看一下!
<p>E-Mail:<INPUT name = tmpE_mail value ="<%=UserEMail%>"></p>
里面的username和useremail 和你定義的是否一樣?你再看一下!
#8
代码在上面
我在好好看看
我在好好看看