第1个回答 推荐于2017-11-23
在servlet里的get或post方法里面,使用request.setAttribute(参数名, 数据);
再在JSP页面里用${参数名}就能得到数据.
或者<%request.getAttribute(参数名);%>也能得到本回答被提问者和网友采纳
第2个回答 2010-06-29
在SERVLET 程序的完成部分加入这个代码
PrintWriter out = response.getWriter();
response.setContentType("text/html; charset=GBK");
//System.out.println(obj); //打印在后台
out.print(obj); //打印在前台,jsp页面上
out.flush();
out.close();
第3个回答 2010-06-29
后台可以把数据存储在request.setAttr..("key",value)或者session里,页面直接.getAttr..("key")得到存储的值.注意<% %> <%= %>的使用
当然页面还可以用jstl,jstl更方便
第4个回答 2010-06-29
我感觉比较直接的是:
把数据存到request或者session里然后在JSP里用代码提取。
个人观点,仅供参考。