当前位置: 代码迷 >> Java Web开发 >> jsp跳转有关问题
  详细解决方案

jsp跳转有关问题

热度:206   发布时间:2016-04-12 22:08:56.0
jsp跳转问题
怎么跳回主界面?

请看代码

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>Welcome to my W3School</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 W3School">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

  </head>
  
  <body >
   <center>
   <a name="pageTop">href="http://www.w3school.com" 
   </a>
   <img alt="W3School"src="<%=basePath%>img/W3School/logo.jpg"/>
   <img alt="Hello,MyFriends" src="<%=basePath %>img/W3School/advert.jpg"/>
   </center>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
   <p>fdfw</p>
  相关解决方案