<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%
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>My JSP 'index.jsp' starting page</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="css/styles.css">
</head>
<body>
<div id="container">
<div id="vote" style="border:#600 medium solid">
<div><h1>投票系统>>>></h1></div>
<table align="center" width="100%" cellpadding="0" cellspacing="0" border=1px;>
<tr align="center">
<td width="15%">序号</td>
<td width="45%">主题</td>
<td width="15%">投票/查看</td>
<td width="25%">创建时间</td>
</tr>
<s:iterator var="subject" value="subjects" status="status">
<s:if test="#status.odd">
<tr align="center" bgcolor="#CC66CC">
</s:if>
<s:if test="#status.even">
<tr align="center" bgcolor="#66FFCC">
</s:if>
<td><s:property value="#subject.getId()"/></td>
<td><a href="detailAction?temp=<s:property value='#subject.getId()'/>"><s:property value="#subject.getTitle()"/></a></td>
<td><s:property value="#subject.getTotalvotes()"/>/<s:property value="#subject.getViewtimes()"/></td>
<td><s:date name="#subject.getCreatedate()" format="yyyy-MM-dd"/></td>
</tr>
</s:iterator>
</table>
</div>
</div>
</body>
</html>
===========
这就是一个完整的jsp页面源码
追问但是我在一个后缀名为html的文件里添加
........
这些,这些会变黑啊,没有效果啊
追答jsp文件的后缀名是.jsp
你把后缀名html改成jsp
追问那这么改还算不算html文件呢?
追答当然不是,后缀名是什么,这个文件就是什么格式的文件
在web服务器中,浏览器可以解析
本回答被提问者和网友采纳