求解JSP中出现这样的错误 求大神帮忙
源代码:(由于字数限制删除了一些没影响的东西主要是出现在提示的那个span上加了之后就把不能显示页面,不加则一切正常求大神帮忙)<%@pagelanguage="java...
源代码:(由于字数限制 删除了一些没影响的东西 主要是出现在提示的那个span上 加了之后就把不能显示页面,不加则一切正常 求大神帮忙)
<%@page language="java" pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>
<html>
<head>
<title>regist</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/style.js" type="text/javascript"></script>
<form action="" method="post" id="regist_form" name="regist_form">
<table cellpadding="0" cellspacing="0" border="0"
class="form_table">
<tr>
<td valign="middle" align="right">
<span class="mark">用 户 名:</span>
</td>
<td valign="middle" align="left">
<input type="text" class="inputgri" name="username" onblur="mySubmit(0);" />
<span id="span_username" style="font-size:12px;color:green;display:none;<%if(request.getAttribute("warnMessage").equals("恭喜你,用户名可用!")){%>display:inline<%}else if(request.getAttribute("warnMessage").equals("该用户名已存在")){ %>color:red;display:inline<%}else{ %><%}%>"><%=request.getAttribute("warnMessage") %></span>
错误提示:
org.apache.jasper.JasperException: An exception occurred processing JSP page /regist.jsp at line 43
40: </td>
41: <td valign="middle" align="left">
42: <input type="text" class="inputgri" name="username" onblur="mySubmit(0);" />
43: <span id="span_username" style="font-size:12px;color:green;display:none;<%if(request.getAttribute("warnMessage").equals("鎭枩浣�鐢ㄦ埛鍚嶅彲鐢�")){%>display:inline<%}else if(request.getAttribute("warnMessage").equals("璇ョ敤鎴峰悕宸插瓨鍦�)){ %>color:red;display:inline<%}else{ %><%}%>"><%=request.getAttribute("warnMessage") %></span>
44:
45: </td>
46: </tr>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.NullPointerException
org.apache.jsp.regist_jsp._jspService(regist_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
noteThe full stack trace of the root cause is available in the Apache Tomcat/6.0.35 logs.
检查了一下 确实是request.getAttribute("warnMessage") 报空了 但是我明明的有提交 而且那边在java程序那边也能接收到提交的内容 可是为什么 捆绑转发之后就不行了? 展开
<%@page language="java" pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>
<html>
<head>
<title>regist</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/style.js" type="text/javascript"></script>
<form action="" method="post" id="regist_form" name="regist_form">
<table cellpadding="0" cellspacing="0" border="0"
class="form_table">
<tr>
<td valign="middle" align="right">
<span class="mark">用 户 名:</span>
</td>
<td valign="middle" align="left">
<input type="text" class="inputgri" name="username" onblur="mySubmit(0);" />
<span id="span_username" style="font-size:12px;color:green;display:none;<%if(request.getAttribute("warnMessage").equals("恭喜你,用户名可用!")){%>display:inline<%}else if(request.getAttribute("warnMessage").equals("该用户名已存在")){ %>color:red;display:inline<%}else{ %><%}%>"><%=request.getAttribute("warnMessage") %></span>
错误提示:
org.apache.jasper.JasperException: An exception occurred processing JSP page /regist.jsp at line 43
40: </td>
41: <td valign="middle" align="left">
42: <input type="text" class="inputgri" name="username" onblur="mySubmit(0);" />
43: <span id="span_username" style="font-size:12px;color:green;display:none;<%if(request.getAttribute("warnMessage").equals("鎭枩浣�鐢ㄦ埛鍚嶅彲鐢�")){%>display:inline<%}else if(request.getAttribute("warnMessage").equals("璇ョ敤鎴峰悕宸插瓨鍦�)){ %>color:red;display:inline<%}else{ %><%}%>"><%=request.getAttribute("warnMessage") %></span>
44:
45: </td>
46: </tr>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.NullPointerException
org.apache.jsp.regist_jsp._jspService(regist_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
noteThe full stack trace of the root cause is available in the Apache Tomcat/6.0.35 logs.
检查了一下 确实是request.getAttribute("warnMessage") 报空了 但是我明明的有提交 而且那边在java程序那边也能接收到提交的内容 可是为什么 捆绑转发之后就不行了? 展开
3个回答
展开全部
还没试过在标签内写jsp代码
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询