JSP新闻发布系统8文档格式.docx

上传人:b****5 文档编号:17364922 上传时间:2022-12-01 格式:DOCX 页数:15 大小:71.71KB
下载 相关 举报
JSP新闻发布系统8文档格式.docx_第1页
第1页 / 共15页
JSP新闻发布系统8文档格式.docx_第2页
第2页 / 共15页
JSP新闻发布系统8文档格式.docx_第3页
第3页 / 共15页
JSP新闻发布系统8文档格式.docx_第4页
第4页 / 共15页
JSP新闻发布系统8文档格式.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

JSP新闻发布系统8文档格式.docx

《JSP新闻发布系统8文档格式.docx》由会员分享,可在线阅读,更多相关《JSP新闻发布系统8文档格式.docx(15页珍藏版)》请在冰豆网上搜索。

JSP新闻发布系统8文档格式.docx

用户可以通过单击每条新闻的标题来查看该条新闻的详细内容。

当用户作为系统管理员,成功登录后,可以使用新闻管理功能。

新闻管理功能包括对现有新闻的修改,增加和删除等。

第3章程序设计流程图

第4章程序部分代码展示

4.1管理员登录页面部分代码

<

scriptlanguage="

JavaScript"

type="

text/javascript"

>

<

!

--

functioncheck()

{

if(document.form1.UserName.value=="

"

{

alert("

请填写用户名!

);

document.form1.UserName.focus();

returnfalse;

}

if(document.form1.UserPwd.value=="

请填写密码!

document.form1.UserPwd.focus();

}

-->

/script>

linkhref="

css/css.css"

rel="

stylesheet"

text/css"

/>

/head>

body>

divid="

content"

head"

imgsrc="

images/head.jpg"

/div>

main"

tablewidth="

428"

height="

258"

border="

0"

align="

center"

tr>

td>

formid="

form1"

name="

method="

post"

action="

adminchk.jsp"

onSubmit="

returncheck()"

379"

195"

border=2align="

bordercolor="

#037c19"

tr>

tdheight="

36"

colspan="

3"

bgcolor="

divclass="

a"

管理员入口<

/td>

/tr>

22"

&

nbsp;

tdwidth="

125"

divalign="

right"

class="

用户名:

2"

left"

label>

inputtype="

text"

UserName"

style="

border:

1pxsolid#037c19"

/label>

密&

码:

42"

password"

UserPwd"

/>

43"

submit"

Submit"

value="

提交"

&

reset"

Submit2"

重置"

/table>

/form>

p>

/p>

/body>

4.2发布新闻部分代码

%@pagecontentType="

text/html;

charset=gb2312"

language="

java"

import="

java.sql.*"

errorPage="

%>

DOCTYPEhtmlPUBLIC"

-//W3C//DTDXHTML1.0Transitional//EN"

"

http:

//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

htmlxmlns="

//www.w3.org/1999/xhtml"

head>

metahttp-equiv="

Content-Type"

content="

title>

管理员登陆<

/title>

if(document.form1.username.value=="

document.form1.username.focus();

if(document.form1.newstitle.value=="

请填写新闻标题!

document.form1.newstitle.focus();

if(document.form1.newstype.value=="

请填写新闻类型!

document.form1.newstype.focus();

if(document.form1.newscontent.value=="

请填写新闻内容!

document.form1.newscontent.focus();

varstr=document.form1.newscontent.value

varreg=newRegExp("

\r\n"

"

g"

str=str.replace(reg,"

br>

document.form1.NewsContent1.value=str;

formname="

newsAddDB.jsp"

get"

onsubmit="

100%"

431"

4"

添加新闻<

196"

31"

tdcolspan="

username"

maxlength="

10"

fontcolor=red>

*<

/font>

class="

>

新闻标题:

newstitle"

新闻类型:

selectname="

newstype"

optionselected="

selected"

/option>

option>

校内新闻<

校外新闻<

国内新闻<

国外新闻<

娱乐新闻<

/select>

129"

新闻内容:

textareaname="

newscontent"

cols="

60"

rows="

/textarea>

INPUTtype="

hidden"

NewsContent1"

--<

IFRAMEID="

eWebEditor1"

src="

eWebEditor\ewebeditor.htm?

id=NewsContent1&

style=full650"

frameborder="

scrolling="

no"

width="

650"

350"

/IFRAME>

-->

41"

发表时间:

%

java.text.SimpleDateFormatformatter=newjava.text.SimpleDateFormat("

yyyy-MM-ddHH:

mm:

ss"

java.util.DatecurrentTime=newjava.util.Date();

//得到当前系统时间

Stringstr_date1=formatter.format(currentTime);

//将日期时间格式化

Stringstr_date2=currentTime.toString();

//将Date型日期时间转换成字符串形式

%>

newsupdatetime"

readonly="

readonly"

value=<

%=str_date1%>

21"

187"

style="

338"

清空"

161"

/html>

4.3修改新闻部分代码

%

StringNewsId=request.getParameter("

Nid"

bytea[]=NewsId.getBytes("

ISO-8859-1"

NewsId=newString(a);

Connectionconn=null;

Statementstmt=null;

ResultSetrs=null;

Stringsql=null;

Class.forName("

com.microsoft.sqlserver.jdbc.SQLServerDriver"

conn=DriverManager.getConnection("

jdbc:

sqlserver:

//localhost:

1433;

DatabaseName=newsAccess"

sa"

stmt=conn.createStatement();

sql="

select*fromNewsInfowhereNewsId='

+NewsId+"

'

;

rs=stmt.executeQuery(sql);

if(rs.next())

Stringusername=rs.getString("

NewsUserName"

formaction="

saveEdit.jsp?

Nid=<

%=NewsId%>

80%"

1"

新闻信息修改<

14%"

86%"

div>

NewsTitle"

id="

textfield"

%=rs.getString("

)%>

size="

80"

87"

新闻内容:

spanclass="

NewsContent"

textarea"

Newscontent"

textareastyle="

display:

none"

<

/span>

palign="

用户名称:

%=username%>

类型:

NewsType"

创建时间:

NewsUpTime"

button"

修改"

inputname="

复原"

}

第5章程序功能调试

一、经过配置服务器环境,该程序基本完成新闻功能的开放,数据库为sqlserver2005服务器为tomcat

二、程序调试部分截图

第6章课程设计心得

通过本次课设,在学习JSP动态网页设计的基础有了深刻的了解,也有了巩固和加深,更对上学期ASP起到温故而知新的作用。

这次的课设论文相当于是大四毕业而论文的一个寓言,是一个必不可少的环节。

尽管本管理系统存在着很多不足,但其功能全面、易于日后程序更新、数据库管理容易、界面友好、操作方便、效率高、安全性好等优点。

相信本新闻发布系统是一套学校在日程管理中必不可少的管理软件,通过开发这个系统,我掌握了项目过程,掌握了基本知识,巩固了我对JSP的学习,但在这次课程设计中的最大收获并不是掌握这几门开发工具的应用,而是学会了设计系统的思维方法,以及与同学们之间相互帮助的精神。

一个学期的JSP课程,这次的课设论文设计是最好的验证,在这次论文设计中,使我受益匪浅,也是对自我的一种检查,资质要学习的东西还很多,他对于我以后的毕业论文起到了无可比拟的作用。

我知道在这次课程设计中自己有很多的欠缺,同时发现自己还有很多没学到的知识,在以后的日子中,我一定的更加严格要求自己,改正缺点,不断努力,不断进步。

第7章参考文献

[1]谢希仁.计算机网络(第五版)[M].北京:

电子工业出版社,2008年2月

[2]范立峰JSP

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高中教育 > 英语

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1