哪位高手知道如何在servlet中连接到一个html页面?

zuoxiaoqin 2001-09-11 04:57:06
我有一程序需实现用户登录,如果用户是系统认证的直接登录到某一页面。
...全文
192 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
cds123 2001-09-11
  • 打赏
  • 举报
回复
上面的ok
Athene 2001-09-11
  • 打赏
  • 举报
回复
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
....

res.sendRedirect("/myHtml/jsp/Approve.jsp");
}
maybe it works!
top1 2001-09-11
  • 打赏
  • 举报
回复
RequestDispatcher dis = getServletContext().getRequestDispatcher("/com/result.jsp");
dis.forward(req, res);

I think it will help for you.
vdragon 2001-09-11
  • 打赏
  • 举报
回复
Interface javax.servlet.http.HttpServletResponse

sendRedirect
public abstract void sendRedirect(String location) throws IOException

Sends a temporary redirect response to the client using the specified redirect location URL. The URL must be absolute (for example, https://hostname/path/file.html). Relative URLs are not permitted here.

Parameters:
location - the redirect location URL
Throws: IOException
If an I/O error has occurred.

不知道是不是你想要的

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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