javaweb关于iframe的问题,高手请进

我想把红线圈中的网页嵌入到500错误那里去
具体如下:
index.jsp中的代码:
jquery:$("#accountBtn").click(function(){ $.post("<%=basePath%>servlet/QuAccServlet",{},function(){ var account = document.getElementById("account"); account.src = "account.jsp"; });
iframe:<iframe width="100%" scrolling="auto" height="100%" frameborder="false" allowtransparency=true style="border: medium none;"id="account"></iframe>

account.jsp中的代码:<%List<Account> accounts=(List<Account>)request.getAttribute("accounts");%>//这句是从servlet传过来的值
我想通过集合遍历把属性值写入表格
<%for(Account account:accounts){ %> <tr> <td class="checkBox"><input name="" type="checkbox" value="" /></td> <td></td> <td><%=account.getAccName()%></td> </tr> <%}%>
可是只要account.jap中一加遍历代码,就报以下异常
<th width="">鎴愬憳缂栧佛</th>38: </thead>39: <tbody>40: <%for(Account account:accounts){41: %>42: <tr>43: <td class="checkBox"><input name="" type="checkbox" value="" /></td>Stacktrace:] with root causejava.lang.NullPointerException at org.apache.jsp.jsp.account_jsp._jspService(account_jsp.java:112) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
也就是图片上的500异常,我是想把account.jsp嵌入到index.jsp中,求高手帮小弟分析分析是哪出了问题,弄了一天了,就卡在了这里

你直接去看看account_jsp.java这个实际被写成什么样了,会不会导致112行抛空指针异常不就行了吗。比如我的web应用部署在tomcat上,名字就叫web,那么这个java文件在work\Catalina\localhost\web\org\apache\jsp.....下面,jboss的话在jboss/server/default/work/.....下面
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网