| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 911 人关注过本帖
标题:谁来帮我看看这个异常到底是什么错啊!!!谢谢了,急啊
只看楼主 加入收藏
crazyboyone
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2009-12-2
收藏
 问题点数:0 回复次数:2 
谁来帮我看看这个异常到底是什么错啊!!!谢谢了,急啊
<html:form action="startExam.do?action=submitTestPaper" method="post">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>
<table id="single" width="90%"  border="0" cellspacing="0" cellpadding="0" align=center>

  <tr>
    <td colspan="4" height=23 style="font-size:11pt;">一、单选题(<font color=red>每题<%=s %>分,答错不得分</font>)</td>
  </tr>
<logic:iterate id="questions" name="singleQue" type="com.exam.struts.form.QuestionForm" scope="request" indexId="ind">
  <tr>
    <td height=23 colspan="4" align=center nowrap>
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="8%" align=right height=23>[&nbsp;${ind+1}&nbsp;]</td>
          <td width="2%">&nbsp;</td>
          <td width="90%" align=left nowrap style="font-size:11pt;"><bean:write name="questions" property="subject" filter="true"/>
          <html:hidden property="idArrS[${ind}]" name="questions"/>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:radio property="answerArrS[${ind}]" styleClass="noborder" value="A"/></td>
    <td width="3%" align=center nowrap>A.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionA" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:radio property="answerArrS[${ind}]" styleClass="noborder" value="B"/></td>
    <td width="3%" align=center nowrap>B.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionB" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:radio property="answerArrS[${ind}]" styleClass="noborder" value="C"/></td>
    <td width="3%" align=center nowrap>C.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionC" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:radio property="answerArrS[${ind}]" styleClass="noborder" value="D"/></td>
    <td width="3%" align=center nowrap>D.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionD" filter="true"/></td>
  </tr>
  </logic:iterate>
</table>

<table id="single" width="90%"  border="0" cellspacing="0" cellpadding="0" align=center>

  <tr>
    <td colspan="4" height=23 style="font-size:11pt;">二、多选题(<font color=red>每题<%=m%>分,答错不得分</font>)</td>
  </tr>
<logic:iterate id="questions" name="moreQue" type="com.exam.struts.form.QuestionForm" scope="request" indexId="ind">
  <tr>
    <td height=23 colspan="4" align=center nowrap>
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="8%" align=right height=23>[&nbsp;${ind+1}&nbsp;]</td>
          <td width="2%">&nbsp;</td>
          <td width="90%" align=left nowrap style="font-size:11pt;"><bean:write name="questions" property="subject" filter="true"/>
          <html:hidden property="idArrM[${ind}]" name="questions"/>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:multibox property="moreSelect[${ind}].answerArr" styleClass="noborder" value="A"/></td>
    <td width="3%" align=center nowrap>A.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionA" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:multibox property="moreSelect[${ind}].answerArr" styleClass="noborder" value="B"/></td>
    <td width="3%" align=center nowrap>B.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionB" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:multibox property="moreSelect[${ind}].answerArr" styleClass="noborder" value="C"/></td>
    <td width="3%" align=center nowrap>C.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionC" filter="true"/></td>
  </tr>
  <tr>
    <td width="8%" height=23 nowrap>&nbsp;</td>
    <td width="3%" align=center nowrap><html:multibox property="moreSelect[${ind}].answerArr" styleClass="noborder" value="D"/></td>
    <td width="3%" align=center nowrap>D.</td>
    <td width="86%" align=left nowrap><bean:write name="questions" property="optionD" filter="true"/></td>
  </tr>
  </logic:iterate>
</table>        
        </td>
      </tr>
        <tr>
          <td align="center"><html:submit property="submit" styleClass="btn_grey" value="交卷"/>          </td>
        </tr>
      </table>
      </html:form>
这提交后出现下面异常

 Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: BeanUtils.populate
    org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
    org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:805)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    com.exam.struts.form.CharFilter.doFilter(CharFilter.java:28)


root cause

java.lang.NullPointerException
    org.(PropertyUtils.java:1458)
    org.(BeanUtils.java:1013)
    org.(BeanUtils.java:808)
    org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493)
    org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:805)
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    com.exam.struts.form.CharFilter.doFilter(CharFilter.java:28)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.
这是form里的
public class QuestionForm extends ActionForm {

    private int id;
   
    private int taotiID;

    private int lessonID;
   
    private String lessonName;
   
    private String taotiName;
   
    private String type;
        
    private String subject;
   
    private String optionA;

    private String optionB;
   
    private String optionC;
   
    private String optionD;

    private String answer;
   
    private String[] answerArray;
   
    private String[] answerArrS;
   
    private MoreSelect[] moreSelect;
   
    private int[] dellArray;

    private String note;
   
    private int[] idArrS;
   

    private int[]  idArrM;
有谁能帮看下啊 ,找了很久了,急啊!!!!
搜索更多相关主题的帖子: request action border 
2009-12-02 23:14
流星雨
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:JAVA风暴
等 级:版主
威 望:43
帖 子:1854
专家分:1868
注 册:2004-5-30
收藏
得分:0 
NullPointerException一般都是你数据没取到,看看你提交的地方,在action或者servlet里打印一下你提交的数据。

感谢你们带我找到星空下美丽神话,无论经历多少苦痛也不放弃的梦;插上希望翅膀乘风我和你们飞翔,飞过海天尽头携手把梦想实现.....
2009-12-17 11:29
柠檬可乐
Rank: 4
等 级:业余侠客
威 望:6
帖 子:66
专家分:205
注 册:2009-6-16
收藏
得分:0 
你应该在form里面加上获取字段的信息

pubic void Setid(int id){
this.id=id;
}

public int getid(){
return id;
}

其他的信息类似
2009-12-17 13:05
快速回复:谁来帮我看看这个异常到底是什么错啊!!!谢谢了,急啊
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013903 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved