📄 ask.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java"
errorPage=""%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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>提问</title>
</head>
<script language="javascript">
<!--
function usercheck(){
var title,content;
title=document.form1.title.value;
content=document.form1.content.value;
if(title==""){
alert("标题不能为空!");
return false;}
if(content==""){
alert("内容不能为空!");
return false;}
}
//-->
</script>
<body>
<%boolean allow=false;
int u_id = 0, grade_id = 0, class_id = 0, subject_id = 0;
String time=null,sort=null;
try{
u_id = Integer.valueOf(session.getAttribute("userid").toString())
.intValue();
grade_id = Integer.valueOf(
session.getAttribute("grade_id").toString()).intValue();
class_id = Integer.valueOf(
session.getAttribute("class_id").toString()).intValue();
subject_id = Integer.valueOf(
session.getAttribute("subject_id").toString()).intValue();
sort=session.getAttribute("sort").toString();
if(sort.equalsIgnoreCase("user")){
allow=user.isallow(u_id)&&!user.isforbid(u_id);
}
if(sort.equalsIgnoreCase("teacher")){
allow=teacher.isallow(u_id);
}
if(sort.equalsIgnoreCase("admin")){
allow=true;
}
}catch(NullPointerException e){}
if(u_id==0||!allow)
response.sendRedirect("error.jsp");
time = java.text.DateFormat.getDateTimeInstance().format(
new java.util.Date());
%>
<div align="center">
<table width="750" height="25" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td width="770" height="155"><iframe name="top" height="155"
width="770" scrolling="no" src="top.jsp" frameborder="0"></iframe></td>
</tr>
</table>
</div>
<form id="form1" name="form1" method="post" action="Servletask">
<input type="hidden" name="action" value="new"><input
type="hidden" name="u_id" value=<%=u_id %>> <input
type="hidden" name="grade_id" value=<%=grade_id%>><input
type="hidden" name="class_id" value=<%=class_id%>><input
type="hidden" name="subject_id" value=<%=subject_id %>><input
type="hidden" name="time" value="<%=time %>">
<input type="hidden"
name="answer_id" value=0><input type="hidden"
name="sort" value="<%=sort %>">
<table width="750" border="0" align="center" cellspacing="1"
bgcolor="#EBEBEB">
<tr bgcolor="#F8F8F8">
<td align="right">
<div align="center" class="STYLE2"><strong>问 题:</strong></div>
</td>
<td width="90%"><label> <input name="title" type="text"
id="title" size="60" /> </label></td>
</tr>
<tr bgcolor="#F8F8F8">
<td>
<div align="center" class="STYLE2">内 容:</div></td>
<td><input type="hidden" name="content" value=" " /><iframe
id="eWebEditor1"
src="editor/eWebEditor.jsp?id=content&style=standard"
frameborder="0" scrolling="no" width="650" height="350"></iframe></td>
</tr>
<tr bgcolor="#F8F8F8">
<td>
<div align="center" class="STYLE2">操 作:</div>
</td>
<td class="STYLE1"><label> <input type="submit"
name="Submit" onClick="javascript:return usercheck();" value="提问" />
<input type="reset" name="Submit2" value="重置" /> </label></td>
</tr>
</table>
</form>
<div align="center">
<table height="155" width="750" border="0" cellspacing="1"
align="center">
<tr>
<td class="STYLE1"><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 + -