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

📄 write1.jsp

📁 java jsp教程
💻 JSP
字号:
<%@ page contentType="text/html; charset=GBK"%>
<%
String jspURL = request.getRequestURI();
if(jspURL.indexOf("jsp")!=-1)
  jspURL = jspURL.substring(jspURL.indexOf("jsp")-1);
if(jspURL.indexOf("?")!=-1)
  jspURL = jspURL.substring(0,jspURL.indexOf("?")-1);
%>
<!-- 个人个人日记新建页面 <%=jspURL%> edited by Ray 2005-11-17 -->
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>写日记 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="<%=request.getContextPath()%>/include/common.js" type="text/JavaScript"></script>
<SCRIPT language=JavaScript>
<!--
function checkform(url)
{
	if (document.formriji.subject.value == "")
	{			
		alert('请填写主题以便以后阅读!');
		document.formriji.subject.focus();
		return false;
	}
	if (document.formriji.content.value == "")
	{			
		alert('请填写内容以便以后阅读!');
		document.formriji.content.focus();
		return false;
	}
    if(getLength(document.formriji.content.value) > 800){
	  alert("输入内容不能超过400个汉字!");
	  document.formmemo.content.focus();
	  return false;
	   }
	document.formriji.action=url+"/servlet/AddJournalServlet";
	document.formriji.submit();
	//location.href='javascript:history.go(-1)';
}

function rewrite(){
	
	document.formriji.subject.value="";
	document.formriji.content.value="";
	return false;
}

//-->
</SCRIPT>
</head>

<body  background="<%=request.getContextPath()%>/images/grid.gif" marginwidth="0" 
marginheight="0">
<br>
<form name="formriji"  action='' method='POST'>
<%
  String formatTime = request.getParameter("_curdate");
  if(formatTime==null){
      Date now=new Date();
      SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
      formatTime = formatter.format(now);
  }
%>
  <input name=time type=hidden value="<%=formatTime%>">
  <table width="75%" border="0" align="center" cellpadding="0" cellspacing="1"  bordercolordark="#DFDFFF" bordercolorlight="#003366" bgcolor="#6699CC">
        <tr bgcolor="#EEF4FF">
          <td height="24" colspan="5" align="center"  bgcolor="#a6d0f2" >写日记</td>
        </tr>
        <tr>
          <td width="100%">
		    <table width="100%"  border="0" align="center" cellpadding="1" cellspacing="0">
              <tr>
                <td background="<%=request.getContextPath()%>/images_new/bg-09.jpg" bgcolor="#D8EAF8" colspan="2">日期:<%=formatTime%></td>
              </tr>
			  <tr>
                      <td background="<%=request.getContextPath()%>/images/bg-13.gif" class="text-01" height="1" colspan="2"></td>
              </tr>
			  <tr>
                <td background="<%=request.getContextPath()%>/images_new/bg-09.jpg" bgcolor="#D8EAF8">主题:<input name="subject" type="text"  size="50" /></td>
				<td width="35%" bgcolor="#D8EAF8"> 天气 
            <select name="weather" >
              <option value="晴" selected>晴</option>
              <option value="阴" >阴</option>
              <option value="多云" >多云</option>
              <option value="晴转多云" >晴转多云</option>
              <option value="小雨" >小雨</option>
              <option value="中雨" >中雨</option>
              <option value="大雨" >大雨</option>
              <option value="阵雨" >阵雨</option>
              <option value="小雪" >小雪</option>
              <option value="中雪" >中雪</option>
              <option value="大雪" >大雪</option>
              <option value="冰雹" >冰雹</option>
              <option value="大风" >大风</option>
            </select>
          </td>
              </tr>
			  <tr>
                      <td background="<%=request.getContextPath()%>/images/bg-13.gif" class="text-01" height="1" colspan="2"></td>
              </tr>
			  
			  <tr><td colspan="2" bgcolor="#D8EAF8">
                <table border="0" align="left" cellpadding="0" cellspacing="0">
                <tr>
                <td width="100%" bgcolor="#D8EAF8" align="left">
	              <textarea name="content" cols=84 rows=16></textarea> 
	              <br>
                </td>
                </tr>
                <tr>
                <td width="100%" align="left" bgcolor="#D8EAF8">&nbsp;&nbsp;日记内容长度限制:中文不能超过400字,英文不超过800个字符</td>
                </tr>
                <tr height="10">
                <td width="100%" align="left" bgcolor="#D8EAF8"></td>
                </tr>
                </table>
              </td></tr>
			  			  
            </table>
		  </td>
        </tr>
</table>
<br>
<br>

    <center>
	  <img src="<%=request.getContextPath()%>/images/save.gif" onclick="checkform('<%=request.getContextPath()%>');" style="cursor:hand">&nbsp;&nbsp;&nbsp;&nbsp;
	  <img src="<%=request.getContextPath()%>/images/clean.gif" onclick="rewrite();" style="cursor:hand"> &nbsp;&nbsp;&nbsp;&nbsp;
	  <img src="<%=request.getContextPath()%>/images/return.gif" onclick="location.href='javascript:history.go(-1)'" style="cursor:hand"> 
	</center>

</form>
</body>
</html>

⌨️ 快捷键说明

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