通过点击按钮实现跳转页面可以使用jsp的表单提交的方法,将要跳转的页面填写在表单的action里,或者在action里面填写一个servlet类,通过这个servlet来处理跳转。
事例代码如下:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Demo</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
<form action="页面地址或者servlet类地址">
<input type="submit" value="跳转"/>
</form>
</body>
</html>
当然,这里不仅可以通过form表单来处理跳转,也可以通过
超链接的方式来实现页面的跳转,将要跳转的页面地址或者servlet类地址填在超链接的href里。