JspWriter out = pageContext.getOut();
HttpSession session = pageContext.getSession();
try
{ String strSql=(String)session.getAttribute(Constants.SQLSTMT_KEY);
Vector addressBookBeans=AddressBookBean.search(strSql); out.println("<table border=\"2\" cellspacing=\"0\" cellpadding=\"0\">");
out.println("<tr>");
out.println("<th BGCOLOR=\"#00FF00\"><b>Name</b></th>");
out.println("<th BGCOLOR=\"#00FF00\"><b>Phone<b></th>");
out.println("<th BGCOLOR=\"#00FF00\"><b>Address</b></th>");
out.println("</tr>"); for(int i=0;i<addressBookBeans.size();i++)
{
AddressBookBean bean=(AddressBookBean)addressBookBeans.elementAt(i);
out.println("<tr>");
out.println("<td>"+ bean.getName() + "</td>");
out.println("<td>" +bean.getPhone() + "</td>");
out.println("<td>"+bean.getAddress()+"</td>");
} out.println("</table>");
}catch (Exception ex)
{
throw new JspTagException("IOException:" + ex.toString());
}
return super.doEndTag();
}
HttpSession session = pageContext.getSession();
try
{ String strSql=(String)session.getAttribute(Constants.SQLSTMT_KEY);
Vector addressBookBeans=AddressBookBean.search(strSql); out.println("<table border=\"2\" cellspacing=\"0\" cellpadding=\"0\">");
out.println("<tr>");
out.println("<th BGCOLOR=\"#00FF00\"><b>Name</b></th>");
out.println("<th BGCOLOR=\"#00FF00\"><b>Phone<b></th>");
out.println("<th BGCOLOR=\"#00FF00\"><b>Address</b></th>");
out.println("</tr>"); for(int i=0;i<addressBookBeans.size();i++)
{
AddressBookBean bean=(AddressBookBean)addressBookBeans.elementAt(i);
out.println("<tr>");
out.println("<td>"+ bean.getName() + "</td>");
out.println("<td>" +bean.getPhone() + "</td>");
out.println("<td>"+bean.getAddress()+"</td>");
} out.println("</table>");
}catch (Exception ex)
{
throw new JspTagException("IOException:" + ex.toString());
}
return super.doEndTag();
}
解决方案 »
- 是否可以推荐一个和fck可以整合的批量上传插件
- servlet HTTP Status 404 问题,查不出问题所在
- weblogic 在同一个servers中 配两个数据源, 两个数据源冲突。我想在一个web应用中使用多个数据源怎么配置啊?请详细说下。
- spring国际化为什么会出现 No message found under code 'j_username' for locale 'zh_CN'.?
- JSP开发环境配置问题
- 编写java程序用什么开发环境最好?是不是jbuilder?
- 又是挺弱智得问题
- 关于jsp的一个技术问题,和一个非技术问题
- 有没有关于Tomcat和Apache整合的文章
- 一个很菜的问题 有人回答吗
- 一个项目到最后去现厂怎么实施?
- 请教: web.xml到底在工程里起什么作用 ??
只要是有问题,一般来说会抛出异常,还是把异常贴来看看。可能在你的后台里面。另外,out用完记得flush一下,一定要close()