知识库系统源代码——信息新增、编辑以及展示源码

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/tangruyi1992/article/details/55049317

一、新增页面如下:


jsp源代码如下:

<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<script type="text/javascript">
	$(function() {
		$('#admin_newsAdd_textarea').xheditor({
			tools : 'full',
			html5Upload : true,
			upMultiple : 4,
			upLinkUrl : '${pageContext.request.contextPath}/News?action=upload',
			upLinkExt : 'zip,rar,txt,doc,docx,xls,xlsx',
			upImgUrl : '${pageContext.request.contextPath}/News?action=upload',
			upImgExt : 'jpg,jpeg,gif,png'
		});
	});
</script>
<div align="center">
	<form id="admin_newsAdd_addForm" method="post">
		<table class="tableForm">
			<tr>
				<!-- <th>编号</th>
				<td><input name="id" readonly="readonly" />
				</td> -->
				<th>信息标题</th>
				<td><input name="name" class="easyui-validatebox" data-options="required:true" />
				</td>
			</tr>
			<tr>
				<th>详细内容</th>
				<td colspan="3"><textarea id="admin_newsAdd_textarea" name="text" style="height: 400px;width:800px;"></textarea>
				</td>
			</tr>
		</table>
	</form>
</div>

二、编辑页面如下:


jsp代码如下:

<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<script type="text/javascript">
	$(function() {
		$('#admin_newsEdit_textarea').xheditor({
			tools : 'full',
			html5Upload : true,
			upMultiple : 4,
			upLinkUrl : '${pageContext.request.contextPath}/News?action=upload',
			upLinkExt : 'zip,rar,txt,doc,docx,xls,xlsx',
			upImgUrl : '${pageContext.request.contextPath}/News?action=upload',
			upImgExt : 'jpg,jpeg,gif,png'
		});
	});
</script>
<div align="center">
	<form id="admin_newsEdit_editForm" method="post">
		<table class="tableForm">
			<tr>
				<th>编号</th>
				<td><input name="id" readonly="readonly" value="${news.id}" /></td>
				<th>信息标题</th>
				<td><input name="name" class="easyui-validatebox" data-options="required:true" value="${news.name}" /></td>
			</tr>
			<tr>
				<th>详细内容</th>
				<td colspan="3"><textarea id="admin_newsEdit_textarea" name="text" style="height: 400px;width: 800px;">${news.text}</textarea></td>
			</tr>
		</table>
	</form>
</div>

三、信息展示页面


shownews.jsp代码如下:

<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
${news.text}


阅读更多

没有更多推荐了,返回首页