当前位置: 技术问答>java相关
哪位高手知道如何在servlet中连接到一个html页面?
来源: 互联网 发布时间:2015-02-02
本文导语: 我有一程序需实现用户登录,如果用户是系统认证的直接登录到某一页面。 | Interface javax.servlet.http.HttpServletResponse sendRedirect public abstract void sendRedirect(String location) throws IOException Sen...
我有一程序需实现用户登录,如果用户是系统认证的直接登录到某一页面。
|
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.
不知道是不是你想要的
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.
不知道是不是你想要的
|
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
....
res.sendRedirect("/myHtml/jsp/Approve.jsp");
}
maybe it works!
{
....
res.sendRedirect("/myHtml/jsp/Approve.jsp");
}
maybe it works!