公司内部测验,这道题应该选什么?

徐蕴 2004-01-13 05:29:21
What approach should be used to rewrite the URL if a servlet needs to send the current request to another servlet?
A. encodeRedirectURL(String url)
B. encodeURL(String url)
C. All URLs must have the session ID concatenated to the value
D. It is done automatically

谢谢!
...全文
40 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
徐蕴 2004-01-17
  • 打赏
  • 举报
回复
看来这道题不容易解释清楚
YuLimin 2004-01-15
  • 打赏
  • 举报
回复
rewrite

send the current request to another servlet

==》A. encodeRedirectURL(String url)
徐蕴 2004-01-14
  • 打赏
  • 举报
回复
我觉得这道题好像不是关于session的,有点像redirect和forward,为什么大家都选C呢
徐蕴 2004-01-14
  • 打赏
  • 举报
回复
能解释一下吗?谢谢
徐蕴 2004-01-14
  • 打赏
  • 举报
回复
我选的是A,D
A可以
String location=response.encodeRedirectURL(“another servlet URL”);
response.sendRedirect(location);
D可以(flyhorse17给的代码)
但是答案是A
flyhorse17 2004-01-14
  • 打赏
  • 举报
回复
request.getRequestDispatcher(URL).forward(request, response);
感觉不是C
filippo1980 2004-01-13
  • 打赏
  • 举报
回复
c
Leemaasn 2004-01-13
  • 打赏
  • 举报
回复
我猜是C。。
NightRanger 2004-01-13
  • 打赏
  • 举报
回复
有人说是c.

50,544

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧