jsp页面重用,include 带有css的jsp布局

html-css023

jsp页面重用,include 带有css的jsp布局,第1张

这个完全应该归咎于css样式表的书写,被footer&header使用的样式绝对不应该影响其他部分的布局。

稍稍懂一点前端的都会对头尾这些专用的模块加个ID等特殊的标示来定义。

实现方法,添加align标签,让table居中,再在视频区右边添加一个表格,把下面的东西拷到表格中。

<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>

<%@ taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<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="styles.css">

-->

<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>

<script type="text/javascript">

// wait for the DOM to be loaded

function verify() {

var url = "/reply?reply.content="+$("#content").val()

+"&movie.id="+$("#movieid").val()

alert(url)

$.get(url,null,function(data){

$("#tt").html(data)

})

}

</script>

</head>

<body>

<table align="center">

<tr>

<td>

<s:property value="movie.name" />

</td>

</tr>

<tr>

<td>

<embed src="images/swf/Flvplayer.swf" allowfullscreen="true"

flashvars="vcastr_file=<s:property value="movie.url"/>"

quality="high"

pluginspage="http://www.macromedia.com/go/getflashplayer"

type="application/x-shockwave-flash" width="500" height="400">

</embed>

</td>

<td>

<s:iterator value="movies">

<a href="/watchMovie.do?movie.id=<s:property value="id"/>"><s:property value="name" /></a>

<br>

</s:iterator>

</td>

</tr>

</table>

<div id="tt"/>

<table>

<s:iterator value="replies">

<tr>

<td>

<a href="/watchMovie.do?movie.id=<s:property value="id"/>">

<s:property value="person.name" />

</a>

says:

<br/><s:property value="date" />

</td>

</tr>

<tr>

<td>

<s:property value="content" />

</td>

</tr>

</s:iterator>

</table>

<form id="replyForm" method="post" action="/reply/reply.do">

<table align="center">

<tr>

<td>

<input id="movieid" type="hidden" name="movie.id" value="<s:property value="movie.id"/>"/>

<textarea id="content" name="reply.content" rows="3" cols="50"></textarea>

</td>

</tr>

<tr>

<td>

<input type="button" value="ok" onClick="verify()">

<input type="submit" value="提交" />

</td>

</tr>

</table>

</form>

</body>

</html>