开发者社区> 问答> 正文

一个简单的网站后台怎么做?(有图的):报错

这个网站的后台的这里怎么做?

我是将这个页面弄成一个类。

然后从后台读取这个类对应的表中的记录。

然后在前台的页面中显示出来。

然后我不明白的是,在网页的内容修改之后,将他的样式也修改了,

如字体变大,或者是字体的颜色等等。。。。

怎么讲它也保存呢?

我觉得应该是修改前台页面的样式了。

可这个是怎么实现的呢?

谢谢回答!!

展开
收起
kun坤 2020-06-06 23:47:00 520 0
1 条回答
写回答
取消 提交回答
  • 这个html编辑器不用你自己实现吧。它说白了就是个文本框。比如你输入hello,存入数据库就是hello,你把颜色变成红色,就是相当于输入了<font color=red>hello</font>你的程序不需要变动。只是存到数据库表中的内容变长了。多了些html标签而已。。######回复 @uniquesql 那么怎么讲这个设置的样式 如<font size="3" >测试〈/font>保存呢? 在哪里保存呢? 找不到啊?######你想多了。比如在JSP页面上直接取出来就行了 <%=blog.getContent()%>。。 或者EL表达式 ${blog.content} 浏览器会自动渲染这些html标记。。######回复 @追逐梦想 : 就当字符串一样读取即可,不用考虑太多######那么前台是怎么读取的呢? 这个是个值啊,怎么会反映到页面上呢?######文字内容保存的是html样式的~~~~~~~~~~~~~~######就是将这个页面中的设置样式一起保存了吧,然后就是怎么讲保存的样式反应到页面上呢?######你发的这个是。。。。 phpweb 生成的企业站 后台的吧
    ######@追逐梦想 哦,呵呵。可能我猜错了######呃,好像不是啊,就是一个网站的后台,有个Html编辑器######归结到底,数据都放到database即可!修改数据库!page取得就是数据库数据!######回复 @Beyond-Bit : 谢谢!######@追逐梦想 设计复杂的,不是一般的难!你简单点,就是把你想变得东西放到数据库,比如:背景颜色你可以放到数据!要修改的时候后台读取,修改!save数据库!页面加载读取数据库即可!######嗯,这个我明白了,但是我不知道怎么讲数据放到数据库中啊。######

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@ taglib uri="/struts-tags" prefix="s"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta content="IE=7.0000" http-equiv="X-UA-Compatible"> <title></title> <link rel="stylesheet" type="text/css" href="css/style(2).css"> <script type="text/javascript" src="js/base(2).js"></script> <script type="text/javascript" src="js/page.js"></script> </head> <body marginheight="0"> <s:iterator value="companyInfo" var="companyInfo"> <form id="modiPageForm" enctype="multipart/form-data" method="post" name="form" action="companyInfoAction_findCompanyInfoById?companyInfoId=<s:property value="#companyInfo.companyInfoId"/>"> <div class="formzone"> <div class="namezone">网页内容编辑</div> <div class="tablezone"> <table style="BORDER-COLLAPSE: collapse" cellspacing="0" cellpadding="2" width="100%" align="center" border="0"> <tbody> <tr> <td height="30" align="center">自定序号</td> <td height="30"><input class="input" style="WIDTH: 25px" maxlength="9" value="<s:property value="#companyInfo.companyInfoId"/>" name="companyInfo.companyInfoId"> </td> </tr> <tr> <td height="30" align="center">网页分组</td> <td height="30"><select id="groupid" name="companyInfo.webPageGroup"> <s:if test="#companyInfo.webPageGroup==1"> <option selected="true" value="1">公司简介</option> <option value="22">联系我们</option> </s:if> <s:else> <option value="1">公司简介</option> <option selected="true" value="22">联系我们</option> </s:else> </select></td> </tr> <tr> <td height="30" align="center">排版方式</td> <td height="30"><select id="modiselmodle" name="companyInfo.typeSetMethod"> <s:if test="#companyInfo.typeSetMethod==1"> <option selected="true" value="1">独立自定义排版</option> <option value="0">共享分组的排版</option> </s:if> <s:else> <option value="1">独立自定义排版</option> <option selected="true" value="0">共享分组的排版</option> </s:else> </select> </td> </tr> <tr id="tr_fold"> <td height="30" align="center">网页文件</td> <td height="30"><input id="pagefolder" class="input" maxlength="30" value="<s:property value="#companyInfo.webPageDocument"/>" name="companyInfo.webPageDocument"> .PHP</td> </tr> <tr> <td height="30" width="100" align="center">网页标题</td> <td height="30"><input id="title" class="input" maxlength="200" size="36" value="<s:property value="#companyInfo.webPageTitle"/>" name="companyInfo.webPageTitle"> <font color="#ff0000">*</font> </td> </tr> <tr> <td height="30" align="center">主题图片</td> <td height="30"><input id="jpg" class="input" size="50" type="file" name="jpg"></td> </tr> <tr> <td height="30" width="100" align="center">网页内容</td> <td height="30"><input type="hidden" value="<s:property value="#companyInfo.webPageContent"/>" name="body"> <script type="text/javascript" src="js/KindEditor.js"></script> <script type="text/javascript"> var editor = new KindEditor("editor"); editor.hiddenName = "body"; editor.editorWidth = "700px"; editor.editorHeight = "350px"; editor.skinPath = "img/"; editor.uploadPath = "../../kedit/upload_cgi/upload.php"; editor.imageAttachPath="page/pics/"; editor.iconPath = "img/"; editor.show(); function KindSubmit() { editor.data(); } </script> <div style="font-family:Courier New;"> <div style="width:700px;;border:1px solid #DDDDDD;background-color:#EFEFEF"> <table cellpadding="0" cellspacing="0" border="0" height="26"> <tbody> <tr> <td style="padding:2px;"><img id="KE_SOURCE" src="img/source.gif" alt="视图转换" title="视图转换" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_SOURCE');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_PREVIEW" src="img/preview.gif" alt="预览" title="预览" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_PREVIEW');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_ZOOM" src="img/zoom.gif" alt="显示比例" title="显示比例" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_ZOOM');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_PRINT" src="img/print.gif" alt="打印" title="打印" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_PRINT');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_UNDO" src="img/undo.gif" alt="回退" title="回退" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_UNDO');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_REDO" src="img/redo.gif" alt="前进" title="前进" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_REDO');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_CUT" src="img/cut.gif" alt="剪切" title="剪切" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_CUT');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_COPY" src="img/copy.gif" alt="复制" title="复制" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_COPY');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_PASTE" src="img/paste.gif" alt="粘贴" title="粘贴" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_PASTE');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_SELECTALL" src="img/selectall.gif" alt="全选" title="全选" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_SELECTALL');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_JUSTIFYLEFT" src="img/justifyleft.gif" alt="左对齐" title="左对齐" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_JUSTIFYLEFT');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_JUSTIFYCENTER" src="img/justifycenter.gif" alt="居中" title="居中" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_JUSTIFYCENTER');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_JUSTIFYRIGHT" src="img/justifyright.gif" alt="右对齐" title="右对齐" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_JUSTIFYRIGHT');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_JUSTIFYFULL" src="img/justifyfull.gif" alt="两端对齐" title="两端对齐" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_JUSTIFYFULL');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_NUMBEREDLIST" src="img/numberedlist.gif" alt="编号" title="编号" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_NUMBEREDLIST');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_UNORDERLIST" src="img/unorderedlist.gif" alt="项目符号" title="项目符号" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_UNORDERLIST');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_INDENT" src="img/indent.gif" alt="减少缩进" title="减少缩进" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_INDENT');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_OUTDENT" src="img/outdent.gif" alt="增加缩进" title="增加缩进" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_OUTDENT');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_SUBSCRIPT" src="img/subscript.gif" alt="下标" title="下标" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_SUBSCRIPT');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_SUPERSCRIPT" src="img/superscript.gif" alt="上标" title="上标" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_SUPERSCRIPT');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_DATE" src="img/date.gif" alt="日期" title="日期" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_DATE');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_TIME" src="img/time.gif" alt="时间" title="时间" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_TIME');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> </tr> </tbody> </table> <table cellpadding="0" cellspacing="0" border="0" height="26"> <tbody> <tr> <td style="padding:2px;"><img id="KE_TITLE" src="img/title.gif" alt="标题" title="标题" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_TITLE');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_FONTNAME" src="img/font.gif" alt="字体" title="字体" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_FONTNAME');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_FONTSIZE" src="img/fontsize.gif" alt="文字大小" title="文字大小" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_FONTSIZE');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_TEXTCOLOR" src="img/textcolor.gif" alt="文字颜色" title="文字颜色" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_TEXTCOLOR');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_BGCOLOR" src="img/bgcolor.gif" alt="文字背景" title="文字背景" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_BGCOLOR');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_BOLD" src="img/bold.gif" alt="粗体" title="粗体" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_BOLD');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_ITALIC" src="img/italic.gif" alt="斜体" title="斜体" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_ITALIC');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_UNDERLINE" src="img/underline.gif" alt="下划线" title="下划线" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_UNDERLINE');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_STRIKE" src="img/strikethrough.gif" alt="删除线" title="删除线" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_STRIKE');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_REMOVE" src="img/removeformat.gif" alt="删除格式" title="删除格式" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_REMOVE');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_IMAGE" src="img/image.gif" alt="图片" title="图片" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_IMAGE');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_FLASH" src="img/flash.gif" alt="Flash" title="Flash" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_FLASH');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_MEDIA" src="img/media.gif" alt="Windows Media Player" title="Windows Media Player" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_MEDIA');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_REAL" src="img/real.gif" alt="Real Player" title="Real Player" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_REAL');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_LAYER" src="img/layer.gif" alt="层" title="层" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_LAYER');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_TABLE" src="img/table.gif" alt="表格" title="表格" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_TABLE');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_SPECIALCHAR" src="img/specialchar.gif" alt="特殊字符" title="特殊字符" align="absmiddle" style="border: 1px solid rgb(239, 239, 239); cursor: pointer; height: 20px;" onclick="javascript:KindExecute('KE_SPECIALCHAR');" onmouseover="javascript:this.style.border='1px solid #AAAAAA';" onmouseout="javascript:this.style.border='1px solid #EFEFEF';"> </td> <td style="padding:2px;"><img id="KE_HR" src="img/hr.gif" alt="横线" title="横线" align="absmiddle" style="border:1px solid #EFEFEF;cursor:pointer;height:20px;" onclick="javascript:KindExecute('KE_HR');" onmo

    2020-06-06 23:47:11
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
钉钉小程序——为工作方式插上翅膀 立即下载
“啄”壮成长-移动app线上日志分析利器 立即下载
“啄”壮成长,移动app线上日志分析利器 立即下载

相关实验场景

更多