?? modjob.jsp
字號(hào):
<jsp:useBean id="mywork" class="oanoticecrud.newsBean" scope="page"/>
<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'news.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript" src="/oa/js/popcalendar.js"></script>
<script language="javascript">
function mycheck()
{
window.opener.location.reload();
}
</script>
</head>
<body>
<%
String username=(String)session.getAttribute("user");
if(username==null) {response.sendRedirect("../index.jsp");}
//這里是修改,故在修改之前我們就要獲得之前的一些數(shù)據(jù),然后將其顯示出來(lái)
oabean.database db=new oabean.database();
oabean.myWorkBean mw=new oabean.myWorkBean();
String pid1=request.getParameter("pid");
int pid=Integer.parseInt(pid1);
mw.setPlanId(pid);
int b=mw.getPlanId();
try
{
//獲取數(shù)據(jù)庫(kù)中的數(shù)據(jù)(這些數(shù)據(jù)是我們要修改的那個(gè)數(shù)據(jù)的id的數(shù)據(jù))并將其顯示在modify頁(yè)面中
String sql="select * from oa_myWork where planId='"+pid+"'";
ResultSet rs=null;
rs=db.executeQuery(sql);
while(rs.next())
{
mw.setUserName(rs.getString("userName"));
mw.setContent(rs.getString("content"));
mw.setEndTime(rs.getString("endTime"));
}
}
catch(Exception e){}
%>
<form action="departmentplan/moddepplan.departmentplan" method="post" ><br><br>
<%--隱藏表單的作用是獲得這個(gè)值然將它傳到一個(gè)servlet上但是不要顯示出來(lái)--%>
<input type="hidden" value="<%=b%>" name="pid">
<label>用戶名</label>
<input type="text" name="uname" size=30 value="<%=mw.getUserName()%>">
<br> <br><br>
<label>內(nèi)容</label>
<br>
<textarea name="content" rows="15" cols="20" ><%=mw.getContent()%></textarea><br>
<label>完成時(shí)間</label>
<input id="sdv" name="endtime" onclick="showCalendar(this, this, 'yyyy-mm-dd','cn',1);" maxlength="20" size="10" value="<%=mw.getEndTime()%>">日
<script>
var osdv = document.getElementById('sdv');
if(osdv != null) osdv.readOnly='true';
</script>
<br>
<br>
<table width="20%">
<tr>
<td><input type="submit" name="sub" value="提交" onclick="mycheck();"></td>
<td> <input type="reset" name="res" value="重置"></td>
</form>
<td><input type="submit" name="guanbi" value="取消" onclick="tb_remove();"></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -