程序出错了,急急!!!嘿嘿!
发表在JavaWeb图书答疑 2009-05-14
是否精华
版块置顶:
[font color=#00FF00][font size=3]第一个[/font]:[/font]
 [font color=#0000FF][font size=2]程序如下[/font]:[/font]
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<%@page import="form.ConsumerForm"%>

<%
ConsumerForm consumerFormPT=(ConsumerForm)session.getAttribute("form");
%>


<body>



<%if(consumerFormPT.getManageLevel().equals("普通")){%>



  <table width="366" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#F1BD36">
          <tr bgcolor="#FFFFFF">
            <td width="171" height="20">用户名:<%=consumerFormPT.getAccount()%></td>
            <td width="195" height="20">姓名:<%=consumerFormPT.getName()%></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td height="20">性别:<%=consumerFormPT.getSex()%></td>
            <td height="20">QQ号码:<%=consumerFormPT.getQQNumber()%></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td height="20">主页:<%=consumerFormPT.getMainPage()%></td>
            <td height="20">兴趣:<%=consumerFormPT.getInterest()%></td>
          </tr>
      <tr bgcolor="#FFFFFF">
            <td height="20">邮箱:<%=consumerFormPT.getEMail()%></td>
            <td height="20" bgcolor="#F1BD36"><a href="head_consumerUpdate.jsp">更改用户信息</a></td>
        </tr>
          </table>
<%} %>


</body>
</html>


      [font size=2][font color=#FF0000]下面是出错的代码[/font]:[/font]
信息: Starting Coyote HTTP/1.1 on http-8080
2009-5-14 16:29:56 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2009-5-14 16:29:56 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/47  config=null
2009-5-14 16:29:56 org.apache.catalina.startup.Catalina start
信息: Server startup in 906 ms
2009-5-14 16:30:00 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.head_005fConsumer_jsp._jspService(head_005fConsumer_jsp.java:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)







[font color=#00FF00][font size=3]第二个[/font]:[/font]
 [font color=#0000FF][font size=2]程序如下[/font]:[/font]
<%@ page contentType="text/html; charset=gb2312" language="java"
import="java.sql.*" errorPage=""%>
<jsp:directive.page import="form.ArticleTypeForm" />
<jsp:directive.page import="form.ArticleForm" />
<jsp:directive.page import="java.util.List" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link type="text/css" rel="stylesheet" href="CSS/style.css">
<script language="javascript" type="text/javascript"
src="JS/validate.js"></script>
<title>博客天空-后台管理</title>
<style type="text/css">
<!--
.style1 {color: #FFCD00}
.style2 {
color: #a54400;
font-weight: bold;
}
body {
background-color: #F0F0F0;
}
.style4 {color: #666666}
-->
</style>
</head>
<jsp:useBean id="countTime" scope="page" class="tool.CountTime"></jsp:useBean>
<jsp:useBean id="articleTypeDao" scope="page" class="dao.ArticleTypeDao"></jsp:useBean>
<jsp:useBean id="articleDao" scope="page" class="dao.ArticleDao"></jsp:useBean>
<%
List list=articleTypeDao.queryArticleType();
ArticleForm articleForm=articleDao.queryArticleForm(Integer.valueOf(request.getParameter("id")));
%>





<body>
<jsp:include page="back_Top.jsp" flush="true" />
<table width="800" border="0" align="center" cellpadding="0"
cellspacing="0" background="images/back1.gif">
<tr>
<td width="227" valign="top">=<jsp:include page="back_Left.jsp" flush="true" />
</td>
<td width="573" valign="top">
<table width="227" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="images/back_noword_03.jpg" width="573" height="25">
</td>
</tr>
</table>
<table width="573" border="0" cellpadding="0" cellspacing="0"
background="images/back_noword_05.jpg">
<tr>
<td valign="top" align="center">

<%out.println("<p align=left>&nbsp;&nbsp;&nbsp;&nbsp;<img src=images/icon.gif width=10 height=10>&nbsp;&nbsp;文章修改</p>");%>
<form name="form" method="post" action="ArticleServlet?method=4&id=<%=articleForm.getId()%>"
onSubmit="return addArticle()">

<table width="340" border="1" cellpadding="1" cellspacing="1"
bordercolor="#FFFFFF" bgcolor="#FECE62">
<tr>
<td width="77" height="30">
<div align="center">
文章主题:
</div>
</td>
<td width="250" bgcolor="#FFFFFF">
<div align="center">
<input name="title" type="text" class="inputinput"
size="30" value="<%=articleForm.getTitle()%>">
</div>
</td>
</tr>

<tr>
<td height="30">
<div align="center">
文章类别:
</div>
</td>
<td bgcolor="#FFFFFF">
<div align="center">

<select name="typeId" class="inputinput">
<%
for(int i=0;i<list.size();i++){ 
ArticleTypeForm form=(ArticleTypeForm)list.get(i);
%>

<option value="<%=form.getId()%>" 

<%if(articleForm.getTypeId().equals(form.getId())){ %>
selected="selected"
<%} %>
><%=form.getTypeName() %></option>


<%} %>
</select>



</div>
</td>
</tr>

<tr>
<td height="30">
<div align="center">
文章内容:
</div>
</td>
<td bgcolor="#FFFFFF">
<div align="center">
<textarea name="content" cols="28" rows="20"
class="inputinput"><%=articleForm.getContent()%></textarea>
</div>
</td>
</tr>
<tr>
<td height="30">
<div align="center">
发布时间:
</div>
</td>
<td bgcolor="#FFFFFF">
<div align="center">
<input name="phTime" type="text" class="inputinput"
value="<%=articleForm.getPhTime()%>" size="30"
readonly="readonly" onclick="alert('此文本框已设为只读,用户不能修改')">
</div>
</td>
</tr>


<tr>
<td height="30">
<div align="center">
访问次数:
</div>
</td>
<td bgcolor="#FFFFFF">
<div align="center">
<input name="number" type="text" class="inputinput"
value="<%=articleForm.getNumber()%>" size="30" readonly="readonly"
onclick="alert('此文本框已设为只读,用户不能修改')">
</div>
</td>
</tr>


</table>
<br>
<input type="image" class="inputinputinput"
src="images/save.gif">
&nbsp;&nbsp;
<a href="#" onClick="javascript:form.reset()"><img
src="images/reset.gif">
</a>
&nbsp;&nbsp;
<a href="#" onclick="javascript:history.go(-1);"><img src="images/back.gif"></a>



</form>

<%
if (request.getAttribute("result") != null) {
out.print(request.getAttribute("result"));
}
%>
</td>
</tr>
</table>
<table width="227" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="images/back_noword_18.jpg" width="573" height="21">
</td>
</tr>
</table>
</td>
</tr>
</table>
<jsp:include page="back_Down.jsp" flush="true" />
</body>
</html>




[font size=2][font color=#FF0000]下面是出错的代码[/font]:[/font]

信息: Server startup in 953 ms
2009-5-14 16:26:56 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:415)
at java.lang.Integer.valueOf(Integer.java:553)
at org.apache.jsp.back_005fArticleUpdate_jsp._jspService(back_005fArticleUpdate_jsp.java:118)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)
分享到:
精彩评论 1
无语_mrkj
学分:3155 LV11
2009-05-16
沙发
请说明这个程序是哪本书中的哪个程序。
首页上一页 1 下一页尾页 1 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照