tomcat中怎么找错? java.lang.NullPointerException at org.apache.jsp.zhuce1_jsp._jspService(zhuce1_jsp.java:77)空指针错误:对空值的对象进行了操作。77: 错误代码行! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 解决了,可是还有一个奇怪的问题,当我从html表单中提交到jsp文件中时,竟提示保存文件到磁盘上,当我点击保存后,再打开那个jsp文件,却以TXT文件显示。 你试过index的测试页吗?可以显示吗?如果可以,看看你调用jsp文件的方法,吧那段代码贴出来看看;如果不可以,呵呵,那就是你配置的事情了/ 还有,控制真错误不是指的用了指针,java里是没有指针的,记住噢!是说队没有值的对象进行了操作,就是null对象操作。 那个问题已解决了,其它的在同一个页面调用的jsp文件也可以,只是从html调用jsp的文件它不在浏览器中显示,当我一提交客户端数据时总是提示文件下载的界面,问我将文件保存在磁盘上还是在当前位置打开,这真是一个怪问题 zhuce1.html:<form method="post" action="zhuce1.jsp"> ??!!我好像也傻了你试试看把zhuce1.jsp换乘存在的另一个jsp文件呢?难道试你这个页面的什么设置有问题?你确认其他的页面调换都没问题? 还真的是zhuce1.jsp有问题,可我还是找不出问题在哪里。我的代码如下:<html><%@ page contentType="html; charset=GBK" %><head><title>注册窗口</title></head><body bgcolor="#CCCCFF"><div align="center"><b><font size="5" color="#CC00CC" face="隶书">注册窗口</font></b></p><hr><%--定义一些字符串变量,用于保存读入的信息--%><%String userid=new String();String userid2=new String();String userpass=new String();String userpass2=new String();String userEmail=new String();String usersex=new String();String userjob=new String();String username=new String();int n;%><%userid=request.getParameter("txtuserid1");userid2=request.getParameter("txtuserid2");userpass=request.getParameter("txtpwd");userpass2=request.getParameter("txtpwd2");userEmail=request.getParameter("txtemail");usersex=request.getParameter("rsex");userjob=request.getParameter("txtuserwork");username=request.getParameter("txtusername");n=userid.length()*userid2.length()*userpass.length()*userpass2.length()*userEmail.length()*username.length();%><% if ((n!=0) &&(userpass.equals(userpass2))){%><p align="center"><b><font color="#CC00CC" face="宋体">注册成功!</font></b></p> <table border="1" cellpadding="0" cellspacing="0" width="525" height="317" align="center" bgcolor="#99CCFF"> <tr> <td width="30" height="34"></td> <td width="89" height="34">用户帐号:</td> <td width="150" height="34"><%=userid%></td> <td width="30" height="34"></td> </tr> <tr> <td width="30" height="34"></td> <td width="89" height="35">用户昵称:</td> <td width="150" height="35"><%=userid2%></td> <td width="30" height="34"></td> </tr> <tr> <td width="30" height="34"></td> <td width="89" height="35">Email:</td> <td width="150" height="35"><%=userEmail%></td> <td width="30" height="34"></td> </tr> <tr> <td width="30" height="34"></td> <td width="89" height="35">真实姓名:</td> <td width="150" height="35"><%=username%></td> <td width="30" height="34"></td> </tr> <tr> <td width="30" height="34"></td> <td width="89" height="35">您的性别:</td> <td width="150" height="35"><%=usersex%>男 <td width="30" height="34"></td></tr> <tr> <td width="30" height="34"></td> <td width="89" height="35">你的职业:</td> <td width="150" height="35"><%=userjob%> </td> <td width="30" height="34"></td> </tr> </table> <% } else{ if(!(userpass.equals(userpass2))){ %><p align="center"><b><font face="宋体" color="#CC00CC" size="+2">密码不符!</font></b></p><%}if (n==0){%><p align="center"><b><font face="宋体" color="#CC00CC" size="+2">注册信息不全!</font></b></p> <%}%><p align="center"><b><font face="宋体" color="#CC00CC" size="+2">注册失败!</font></b></p> <%}%></div></body></html> 我知道了,是<%@ page contentType="html; charset=GBK" %> 惹的祸,我去掉它就会显示一些乱码,不去掉就会出现文件下载的对话框。 <%@ page contentType="html; charset=gb2312" %> to mim(苍之封印) :还是一样的呀 为什么这语句在别的jsp文件中都没问题,在这里就不行了。 最近刚学了下DWR,然后想用它写个登录 cookie中的name有什么用 各位高手们,请帮帮忙,有谁知道将struts2标签输出的错误信息改变成JavaScript方式提示 html 框架问题。 IFrame标签如何支持手动调整大小 这个问题谁帮我解决以下 高手进来看下:我的jsp运行不了啊(急) http://localhost:8080 怎么也打不开,急! 关于统计图的生成,用表格或者图片怎样来实现? java爬虫 抓取天猫商品信息 重定向问题 求救! 大虾请进!取值并判断是否显示!急!!! 连DB2数据库时候遇到的问题.
<form method="post" action="zhuce1.jsp">
我好像也傻了
你试试看把zhuce1.jsp换乘存在的另一个jsp文件呢?难道试你这个页面的什么设置有问题?你确认其他的页面调换都没问题?
<%@ page contentType="html; charset=GBK" %>
<head>
<title>注册窗口</title>
</head><body bgcolor="#CCCCFF"><div align="center">
<b><font size="5" color="#CC00CC" face="隶书">注册窗口</font></b></p>
<hr>
<%--定义一些字符串变量,用于保存读入的信息--%>
<%
String userid=new String();
String userid2=new String();
String userpass=new String();
String userpass2=new String();
String userEmail=new String();
String usersex=new String();
String userjob=new String();
String username=new String();
int n;
%>
<%
userid=request.getParameter("txtuserid1");
userid2=request.getParameter("txtuserid2");
userpass=request.getParameter("txtpwd");
userpass2=request.getParameter("txtpwd2");
userEmail=request.getParameter("txtemail");
usersex=request.getParameter("rsex");
userjob=request.getParameter("txtuserwork");
username=request.getParameter("txtusername");
n=userid.length()*userid2.length()*userpass.length()*userpass2.length()*userEmail.length()*username.length();
%><%
if ((n!=0) &&(userpass.equals(userpass2)))
{
%>
<p align="center"><b><font color="#CC00CC" face="宋体">注册成功!</font></b></p>
<table border="1" cellpadding="0" cellspacing="0" width="525" height="317" align="center" bgcolor="#99CCFF">
<tr>
<td width="30" height="34"></td>
<td width="89" height="34">用户帐号:</td>
<td width="150" height="34"><%=userid%></td>
<td width="30" height="34"></td>
</tr>
<tr>
<td width="30" height="34"></td>
<td width="89" height="35">用户昵称:</td>
<td width="150" height="35"><%=userid2%></td>
<td width="30" height="34"></td>
</tr>
<tr>
<td width="30" height="34"></td>
<td width="89" height="35">Email:</td>
<td width="150" height="35"><%=userEmail%></td>
<td width="30" height="34"></td>
</tr>
<tr>
<td width="30" height="34"></td>
<td width="89" height="35">真实姓名:</td>
<td width="150" height="35"><%=username%></td>
<td width="30" height="34"></td>
</tr>
<tr>
<td width="30" height="34"></td>
<td width="89" height="35">您的性别:</td>
<td width="150" height="35"><%=usersex%>男
<td width="30" height="34"></td></tr>
<tr>
<td width="30" height="34"></td>
<td width="89" height="35">你的职业:</td>
<td width="150" height="35"><%=userjob%>
</td>
<td width="30" height="34"></td>
</tr>
</table>
<%
}
else{
if(!(userpass.equals(userpass2))){
%>
<p align="center"><b><font face="宋体" color="#CC00CC" size="+2">密码不符!</font></b></p>
<%
}
if (n==0){
%>
<p align="center"><b><font face="宋体" color="#CC00CC" size="+2">注册信息不全!</font></b></p>
<%
}
%>
<p align="center"><b><font face="宋体" color="#CC00CC" size="+2">注册失败!</font></b></p>
<%
}
%>
</div>
</body></html>