如何链接到另一个文件夹的网页?

时间:2015-03-18 04:29:58

标签: html jsp hyperlink

我的目录树在下面给出

WebContent(Folder)
      |
      |_____home.jsp(Page)
      |_____User(Folder)
                |
                |_____________deposit.jsp(Page)

下面是我给出的deposit.jsp页面 的 deposit.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
    user deposit
    <a href="~/home.jsp">home</a>
</body>
</html>

但是它无法进入SendMail.jsp页面。那么如何从deposit.jsp链接到home.jsp?

1 个答案:

答案 0 :(得分:1)

您可以按照以下方式更改 deposit.jsp 页面。它将正常运行。

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
    user deposit
    <a href="${pageContext.request.contextPath}/home.jsp">home</a>
</body>
</html>