📄 modifyanswer.jsp
字号:
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="GB2312"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<jsp:useBean id="user" scope="page" class="edu.UserBean" />
<jsp:useBean id="teacher" scope="page" class="edu.TeacherBean" />
<title>Insert title here</title>
</head>
<script language="javascript">
<!--
function usercheck(){
var content;
content=document.myform.content.value;
if(content==""){
alert("内容不能为空!");
return false;}
}
//-->
</script>
<%
int a_id=0,userid=0,ans_id=0;
String title="",sort="",content="",ans_sort="",ask_id="";
try{
ask_id=session.getAttribute("ask_id").toString();
userid=Integer.valueOf(session.getAttribute("userid").toString()).intValue();
sort=session.getAttribute("sort").toString();
title=session.getAttribute("title").toString();
content=session.getAttribute("ans_content").toString();
ans_sort=session.getAttribute("ans_sort").toString();
ans_id=Integer.valueOf(session.getAttribute("ans_id").toString()).intValue();
}catch(NullPointerException e){}
try{
a_id =Integer.valueOf(request.getParameter("answer_id")).intValue();
}catch(NumberFormatException e){}
boolean allow=false;
if(sort.equalsIgnoreCase("user")){
allow=user.isallow(userid)&&!user.isforbid(userid);
}
if(sort.equalsIgnoreCase("teacher")){
allow=teacher.isallow(userid);
}
if(sort.equalsIgnoreCase("admin")){
allow=true;
}
if(userid==0||(userid!=ans_id&&!sort.equalsIgnoreCase("admin"))||(!sort.equalsIgnoreCase(ans_sort)&&!sort.equalsIgnoreCase("admin"))||!allow)
response.sendRedirect("error.jsp");
String time = java.text.DateFormat.getDateTimeInstance().format(new java.util.Date());
%>
<body>
<div align="center">
<table height="155" width="750" border="0" cellspacing="1"
align="center">
<tr>
<td><iframe name="top" height="155" width="750" scrolling="no"
src="top.jsp" frameborder="0"></iframe></td>
</tr>
</table>
</div>
<FORM method="POST" name="myform" action="Servletanswer"><input
type="hidden" name="action" value="update"> <input
type="hidden" name="id" value="<%=a_id %>"> <input
type="hidden" name="time" value="<%=time %>"> <input
type="hidden" name="ask_id" value="<%=ask_id %>">
<div align="center">
<table width="100%" border="0" align="center">
<tr>
<td align="right"> </td>
<td></td>
</tr>
<tr>
<td align="right"> </td>
<td width="81%"><label> RS:<%=title %> </label></td>
</tr>
<tr>
<td> </td>
<td><input type="hidden" name="content" value='<%=content %>' /><iframe
id="eWebEditor1"
src="editor/eWebEditor.jsp?id=content&style=standard"
frameborder="0" scrolling="no" width="650" height="350"></iframe></td>
</tr>
<tr>
<td> </td>
<td><label> <input type="submit" name="Submit"
onClick="return usercheck()" value="提问" /> <input type="reset"
name="Submit2" value="重置" /> </label></td>
</tr>
</table>
</div>
</FORM>
<div align="center">
<table height="155" width="750" border="0" cellspacing="1"
align="center">
<tr>
<td><iframe name="bottom" height="155" width="750" scrolling="no"
src="bottom.jsp" frameborder="0"></iframe></td>
</tr>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -