⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit.jsp

📁 本书由浅入深、循序渐进地介绍了MVC的体系结构和如何构建一个基于MVC的Web框架
💻 JSP
字号:
<%@ page contentType="text/html; charset=GBK" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.sql.*,java.util.*,javax.servlet.*,
		 javax.servlet.http.*,java.text.*,com.gd.mvc.util.GdDate,java.math.*,com.myContent.vo.ContentType,com.myContent.vo.Content,com.gd.mvc.io.InfoInAndOut,com.gd.mvc.io.impl.GdInfoInAndOut"
%>
<%! public static final String _AppId = "edit"; %>
<%
	InfoInAndOut infoOut = (request.getAttribute("infoOut") == null) ? new GdInfoInAndOut() : (InfoInAndOut)request.getAttribute("infoOut");
	String msg = infoOut.get("msg") == null ? "" : (String)infoOut.get("msg");
	List contentList = infoOut.get("contentList") == null ? new ArrayList(): (ArrayList)infoOut.get("contentList");
	Content content = infoOut.get("content") == null ? new Content() : (Content)infoOut.get("content");	
	List contentTypeList = infoOut.get("contentTypeList") == null ? new ArrayList(): (ArrayList)infoOut.get("contentTypeList");
	String username = infoOut.get("username") == null ? "" : (String)infoOut.get("username");
	String userId = infoOut.get("userId") == null ? "" : (String)infoOut.get("userId");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>内容编辑发布</title>
<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-weight: bold;
}
body {
	background-color: #FFFFFD;
	font-family: Verdana, "宋体";
	font-size: 12px;
	font-style: normal;
}
-->
</style>
<script language=Javascript>
function submit(target, action) {
    form1.target = target;   
    form1.action.value = action;
    form1.submit();
}
function openWin(name, url, width, height) {
	var screenWidth = screen.width;
	var screenHeight = screen.height;
	var w;
    	w = window.open(url, name, "width="+width+",height="+height+",menubar=no,resizable=yes,toolbar=no,directories=no,location=no,scrollbars=yes,status=yes,copyhistory=0");
	w.moveTo((screenWidth-width)/2, (screenHeight-height)/2);
	w.focus();
}
function goExit() {
	window.close();
}
function check(action) {
	submit('<%="edit_"+session.getId()%>',action);
}
</script>
<SCRIPT  LANGUAGE=javascript>
<!--
_editor_url = "../js/";
-->
</script>
</head>
<SCRIPT LANGUAGE="JScript" SRC="../js/editor.js"> </SCRIPT>
<body>
<form action="/myContent/myContent/edit.do" method="post"  name="form1">
  <table width="100%" border="1">
    <tr>
      <td height="17" colspan="2"><div align="center">内容编辑发布『<span class="style1">消息提示:<%=msg%></span>』</div></td>
    </tr>
    <tr>
      <td height="44"><div align="right">已存在的内容:</div></td>
      <td><ol>
      <%
          
          	   for (int i = 0; contentList != null && contentList.size() > i; i++) {
      			Content contentTemp = (Content)contentList.get(i);	
          %>
          <li>
            <input type="checkbox" name="chk" value="<%=i%>">
            <input type="hidden" name="id<%=i%>_contentMany" value="<%=contentTemp.getId()%>">
            
            <%=contentTemp.getTitle()%></li>    
          <%}%>
   
      </ol></td>
    </tr>
    <tr>
      <td width="320"> <div align="right">内容标题:</div></td>
      <td width="440"><input name="title_content" type="text" size="100" maxlength="100" value="<%=content.getTitle()%>"></td>
    </tr>
    <tr>
      <td><div align="right">内容正文:</div></td>
      <td><textarea id="content" name="content_content" cols="76" rows="17" value="<%=content.getContent()%>"></textarea>&nbsp;</td>
    </tr>
    <tr>
      <td><div align="right">内容类别:</div></td>
      <td><select name="contentTypeId_content">
       <%
          	   String selected ="";
          	   for (int i = 0; contentTypeList != null && contentTypeList.size() > i; i++) {
      			ContentType contentTypeTemp = (ContentType)contentTypeList.get(i);
      			if (contentTypeTemp.getId()==content.getContentTypeId()) {
      				selected = "selected";
      			} else {
      				selected = "";
      			}
          %>
          <option value = '<%=contentTypeTemp.getId()%>' <%=selected%>><%=contentTypeTemp.getContentTypeName()%></option>
          <%}%>
      </select></td>
    </tr>
    <tr>
      <td><div align="right">发布日期:</div></td>
      <td><%= (content.getDateTime() == null || "".equals(content.getDateTime())) ? GdDate.getCurrentDateAndTime() : content.getDateTime()%></td>
    </tr>
    <tr>
      <td><div align="right">发布人:</div></td>
      <td><%=content.getUserId()%></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center"></div>        <div align="center">
         <input type="button" name="button" value="发布" onClick="return check('insert')">
      <input type="button" name="button" value="修改" onClick="return check('update')">
      <input type="button" name="button" value="删除" onClick="return check('delete')">
      </div></td>
    </tr>
  </table>
  <input type="hidden" name="action" value="">
  <input type="hidden" name="username" value="<%=username%>">
  <input type="hidden" name="userId" value="<%=userId%>">
</form>
</body>
</html>
<script language="javascript1.2">
editor_generate('content');
form1.content.value = '<%=content.getContent()%>';
window.name = "<%="edit_"+session.getId()%>";    
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -