Home >Web Front-end >HTML Tutorial >如何在jsp页面中包含另一个jsp页面_html/css_WEB-ITnose

如何在jsp页面中包含另一个jsp页面_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:16:162040browse

我想在一个jsp页面中包含另一个在同一目录下的jsp页面,使用的语句为

但是Myeclipse报错

错误信息:
Multiple annotations found at this line:
- Duplicate local variable 
 basePath
- Duplicate local variable path
- Duplicate local variable 
 basePath
- Duplicate local variable path


回复讨论(解决方案)

代码问题,有些变量定义不能在2个文件中都有

我把代码贴上

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%><%	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>博客栏目</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"><!--	<link rel="stylesheet" type="text/css" href="styles.css">	--><style type="text/css">body {	background: url(image/projectBG.jpg);}.head {	margin-top: 50px;	text-align: center;	font-size: 24px;	color: #FF9933;}.head pre {	font-weight: 900;}.blog {	text-align: center;	margin-top: 100px;}.blog a {	color: red;	font-size: 20px;}</style></head><body>	<div class="head">		<pre style="font-weight:900">${project}栏目

${user.title }
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn