Holen@Blog

Holen Bolg on Donews.net

  DonewsBlog  |  Donews首页  |  Donews社区  |  Donews邮箱  |  我的首页  |  联系作者  |  聚合   |  登录
  216篇文章 :: 0篇收藏:: 353篇评论:: 6个Trackbacks

公告

Free Counters

文章

收藏

相册

我的原创文章

存档


正在读取评论……


dispatcher能把request中的内容传到下一页面,而sendredirect则不能,但在用dispatcher时,不能有任何对页面的输出,否则报错。
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    request.setAttribute("username",username);
    request.setAttribute("password",password);
    ServletContext context = this.getServletContext();
    String target = "/test1/hello.jsp";
    RequestDispatcher dispatcher = context.getRequestDispatcher(target);
    dispatcher.forward(request,response);
以上是用法示例题,把对象置入request,然后用dispatcher传送。这段内容在servlet中实现。

Trackback: http://tb.donews.net/TrackBack.aspx?PostId=23173


[点击此处收藏本文]  发表于2004年05月28日 10:23 PM




正在读取评论……

发表评论

大名:
网址:
验证码
评论