注册 登录
编程论坛 J2EE论坛

servlet中如何根据不同的条件转道不同的页面?

禹_二 发布于 2006-12-16 22:26, 499 次点击

求助!

2 回复
#2
limo2006-12-17 00:46


+++++++++++++++++++++
String toUrl = "/page1.jsp";
if(condition1){
toUrl = "/page2.jsp";
}
else if(condition2){
toUrl = "/page3.jsp";
}
+++++++++++++++++++++
getServletConfig().getServletContext().getRequestDispatcher(toUrl).forward(request,response);

判断

不知道你问的是这个吗?

#3
禹_二2006-12-17 08:53

差不多,以前见过,现在忘了.谢了

1