<%@ page language= "java" import = "java.util.*" pageEncoding= "utf-8" %> |
<%@ taglib prefix= "s" uri= "/struts-tags" %> |
<% |
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> |
<style type= "text/css" > |
* { |
font-family: "微软雅黑" , Verdana, sans-serif, "宋体" ; |
} |
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, p, blockquote, th, td { |
margin: 0 ; |
padding: 0 ; |
} |
h1 { |
color: #09C; |
} |
.title { |
text-align: center; |
} |
.title a { |
color: # 933 ; |
font-size: 24px; |
} |
.id { |
float : right; |
color: # 666 ; |
margin-right: 20px; |
font-size: 12px; |
} |
.time { |
float : right; |
color: # 666 ; |
font-size: 12px; |
} |
.item { |
margin-top: 10px; |
margin-bottom: 30px; |
} |
body { |
width: 960px; |
margin-right: auto; |
margin-left: auto; |
} |
.content { |
clear: both; |
text-indent: 2em; |
} |
</style> |
</head> |
<body> |
<h1> 新闻列表 </h1> |
<s:iterator value= "list" status= "statu" id= "item" > |
<div class = "item" > |
<div class = "header" > |
<div class = "title" > <a href= " <s:property value=" url " />" target= "_blank" > |
<s:property value= "title" /> |
</a> </div> |
<span class = "time" > 发布日期: |
<s:property value= "theTime" /> |
</span> <span class = "id" > ID: |
<s:property value= "id" /> |
</span> </div> |
<div class = "content" > |
<s:property value= "content" /> |
</div> |
</div> |
</s:iterator> |
<br> |
</body> |
</html> |
*************************************** |
************数据库脚本**************** |
*************************************** |
SET FOREIGN_KEY_CHECKS= 0 ; |
-- ---------------------------- |
-- Table structure for `homenews` |
-- ---------------------------- |
DROP TABLE IF EXISTS `homenews`; |
CREATE TABLE `homenews` ( |
`id` int ( 10 ) unsigned NOT NULL AUTO_INCREMENT, |
`title` varchar( 50 ) NOT NULL, |
`url` varchar( 255 ) NOT NULL, |
`content` text NOT NULL, |
`theTime` date NOT NULL, |
PRIMARY KEY (`id`) |
) ENGINE=InnoDB AUTO_INCREMENT= 4 DEFAULT CHARSET=utf8; |
-- ---------------------------- |
-- Records of homenews |
-- ---------------------------- |
INSERT INTO `homenews` VALUES ( '1' , '上海感染H7N9禽流感4岁男童康复' , 'http://news.ifeng.com/mainland/special/h7n9/content-3/detail_2013_04/08/23947079_0.shtml' , '昨天,国家卫生和计划生育委员会通报,4月6日17时至4月7日17时,全国报告新增人感染H7N9禽流感确诊病例3例,2例来自上海,1例来自安徽。至此,全国共报告21例确诊病例。报告的确诊病例间未发现流行病学联系。所有病例的密切接触者医学观察均未现异常。' , '2013-04-08' ); |
INSERT INTO `homenews` VALUES ( '2' , '美国为免遭朝鲜误判推迟洲际导弹试射' , 'http://news.jschina.com.cn/system/2013/04/08/016816727.shtml' , '东方网4月8日消息:美国国防部官员6日说,鉴于朝鲜半岛局势紧张,推迟原定下周在加利福尼亚州进行的“民兵3”型洲际弹道导弹试射,以避免“形势遭误读和误判”。日本媒体7日报道称,日本自卫队已经做好了拦截朝鲜新型导弹的准备。日本防卫相小野寺五典将在未来一两天内下达“摧毁命令”,对朝鲜有可能发射的弹道导弹实施拦截。' , '2013-04-08' ); |
INSERT INTO `homenews` VALUES ( '3' , '浙江蒙冤叔侄接受采访:警方曾连续逼供7天7夜' , 'http://www.people.com.cn/24hour/n/2013/0408/c25408-21048283.html' , '王宁:刚才的郭川让我们看到的坚持的分量,而本周还有两个人的坚持更加触动我们,他们的坚持时间更长,为了争取自己的自由,他们坚持了整整十年,他们是一起冤案的当事人,就是照片上身着囚服的叔侄儿子,叔叔叫张高平,侄子叫张辉,安徽歙县人,十年前,在强奸杀人的罪名之下,两个人锒铛入狱,十年之后,法院宣判他们无罪,在无罪判决书上签字之后,两个人的脸上露出了久违的笑容。\r\n' , '2013-04-08' ); |
高级设计师
by: 小蜜锋 发表于:2013-04-08 12:57:09 顶(6) | 踩(1) 回复
软件构造实验二,你懂的。。。
回复评论