📄 insertnews.jsp
字号:
<%
/**
* $RCSfile: insertnews.jsp,v $
* $Author: Dingyuezong $
* $Revision: 1.0 $
* $Date: 2001/04/10 $
*/
%>
<%@ page
import="java.util.*,
java.io.*,
java.text.*,
java.sql.*,
com.everstar.usermanage.*,
com.everstar.news.*"
%>
<% /////////////////
// header include
String title = "Post News";
%>
<%
//user permission check! --operate name: NEWS_POST
HttpSession AuthInfoPool=request.getSession();
if (!Auth.islogin(AuthInfoPool))
{
%>
<jsp:include page="../header.jsp" flush="true"/>
<meta http-equiv="refresh" content="2;URL='../login.jsp">
You should login first!
<jsp:include page="../footer.jsp" flush="true"/>
<%
//response.sendRedirect("../login.jsp");
return;
}
else
{
boolean canOperate = Auth.havePerm("NEWS_POST",AuthInfoPool);
if (!canOperate)
{
%>
<jsp:include page="../header.jsp" flush="true"/>
<!--meta http-equiv="refresh" content="2;URL='../login.jsp"-->
<H3>You have no permission to operate the function! <a href="javascript:history.go(-1);">Back</a></h3>
<jsp:include page="../footer.jsp" flush="true"/>
<%
return;
}
}
%>
<jsp:include page="../header.jsp" flush="true"/>
>>News>><a href="listnews.jsp">List News</a>>><a href="searchnews.jsp">Search News</a>
>>Post News
<%
boolean canOperate1 = Auth.havePerm("NEWS_MODIFY",AuthInfoPool);
if (canOperate1)
{
%>
>><a href="modifynews.jsp">Modify News</a>
<%
}
%>
<%
boolean canOperate2 = Auth.havePerm("NEWS_DELETE",AuthInfoPool);
if (canOperate2)
{
%>
>><a href="deletenews.jsp">Delete News</a>
<%
}
%>
<div align=center>
<p>Post News</p>
<hr size="0">
<jsp:useBean id="cc" scope="page" class="com.everstar.news.ErrorCheck" />
<%
ErrorCheck ec = new ErrorCheck();
ec.setFormName("insert");
ec.lengthCheck("title","The string you input in the first field in not between 2-100",2,100);
ec.lengthCheck("source","The string you input in the second field in not between 2-100",2,100);
ec.lengthCheck("summary","The string you input in the third field in not between 2-200",2,200);
ec.lengthCheck("body","The string you input in the fourth field in not between 2-4000",2,4000);
ec.lengthCheck("author","The string you input in the fifth field in not between 2-20",2,20);
out.println(ec.ErrorCheckScript());
%>
<form name=insert method=post onsubmit="return errorCheck();" action="insertdo.jsp">
<table width="90%" border="0">
<tr>
<td>Title</td>
<td>
<input type="text" name="title">
</td>
</tr>
<tr>
<td>Source</td>
<td>
<input type="text" name="source">
</td>
</tr>
<tr>
<td>Summary</td>
<td>
<input type="text" name="summary">
</td>
</tr>
<tr>
<td>Body</td>
<td>
<textarea name="body" cols="50" rows="5"></textarea>
</td>
</tr>
<tr>
<td>Author</td>
<td>
<input type="text" name="author">
</td>
</tr>
<tr>
<td>
<input type="hidden" name="fname" size=20>
</td>
</tr>
<tr>
<td>
<input type="submit" name="submit" value="Submit">
</td>
<td>
<input type="reset" name="cancel" value="Cancel">
</td>
</tr>
</table>
</form>
</div>
<br>
<jsp:include page="../footer.jsp" flush="true"/>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -