📄 myfile.jsp
字号:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.*,java.io.*"%>
<script>
function trim(srcStr)
{
var i,j,len;
len=srcStr.length;
for(i=0;i<len;i++)
if(srcStr.charAt(i)!=' ') break;
for(j=len-1;j>=i;j--)
if(srcStr.charAt(j)!=' ') break;
if(i>j) return "";
else return srcStr.substr(i,j-i+1);
}
function upfile(){
if(trim(document.getElementById("filename").value).length<1){
alert("必须填写文件名");
document.getElementById("filename").focus();
return false;
}
return true;
}
</script>
<table width="580" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="290"></td>
</tr>
<tr>
<td height="28"><span class="Song_12_333333"><img src=" images/icon_9.gif" width="22" height="22" hspace="5" align="absmiddle" />当前</span><span style="color:#FF0000"> <html:errors/></span></td>
</tr>
<tr>
<td height="2" bgcolor="#EC2178" class="Song_12_333333"></td>
</tr>
<tr>
<td><table width="580" border="1" cellpadding="5" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#EDECEC" class="Song_12_333333">
<form action="FileAction.do?method=createNewFile" method="post" onsubmit="return upfile()"/>
<tr>
<td width="130" height="26" align="center">输入文件名:</td>
<td width="424" bgcolor="#F6F6F6"><input id="filename" name="filename" type="text" class="Song_12_666666_input" size="20" />
<input name="Submit" type="submit" class="Song_12_666666_input" value="提交" style="cursor:hand" />
(新增文件目录不能超过五个)</td>
</tr>
</form>
</table></td>
</tr>
<tr>
<td height="2" bgcolor="#EC2178"></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="40"><table width="580" border="1" cellpadding="5" cellspacing="0" bordercolor="#FFFFFF" class="Song_12_333333">
<logic:present name="result" scope="request">
<logic:iterate id="arraylist" name="result">
<tr>
<form name="FileForm" id="<bean:write name="arraylist" property="photofileId"/>" action="FileAction.do?method=makeFile" method="post" >
<td width="38" class="tt"><img src="images/icon_9.gif" width="22" height="22" align="absmiddle" /></td>
<td width="325" class="tt">
<label id='one<bean:write name="arraylist" property="photofileId"/>'>
<bean:write name="arraylist" property="filename"/>
</label>
<input type="text" name="filename" id='two<bean:write name="arraylist" property="photofileId"/>' value="<bean:write name="arraylist" property="filename"/>" size="15" style="display:none" maxlength="12"/>
<input type="hidden" name="fileId" value="<bean:write name="arraylist" property="photofileId"/>"/>
<td width="92" align="center" class="tt">
<a id='three<bean:write name="arraylist" property="photofileId"/>' href='javascript:text<bean:write name="arraylist" property="photofileId"/>()' >[ 编辑 ]</a>
<a id='sub<bean:write name="arraylist" property="photofileId"/>' href='javascript:document.getElementById("<bean:write name="arraylist" property="photofileId"/>").submit();' style="display:none" >[ 修改 ]</a>
<a id='sub2<bean:write name="arraylist" property="photofileId"/>' href='javascript:text2<bean:write name="arraylist" property="photofileId"/>()' style="display:none" >[ 取消 ]</a> </td>
<td width="75" align="center" class="tt">[ <a href='FileAction.do?method=deleteFile&filenameId=<bean:write name="arraylist" property="photofileId"/>'>删除</a> ]
<script>
//ύ
function text<bean:write name="arraylist" property="photofileId"/>(){
document.getElementById("one<bean:write name="arraylist" property="photofileId"/>").style.display="none";
document.getElementById("two<bean:write name="arraylist" property="photofileId"/>").style.display="";
document.getElementById("three<bean:write name="arraylist" property="photofileId"/>").style.display="none";
document.getElementById("sub<bean:write name="arraylist" property="photofileId"/>").style.display="";
document.getElementById("sub2<bean:write name="arraylist" property="photofileId"/>").style.display="";
}
//ȡ
function text2<bean:write name="arraylist" property="photofileId"/>(){
document.getElementById("one<bean:write name="arraylist" property="photofileId"/>").style.display="";
document.getElementById("two<bean:write name="arraylist" property="photofileId"/>").style.display="none";
document.getElementById("three<bean:write name="arraylist" property="photofileId"/>").style.display="";
document.getElementById("sub<bean:write name="arraylist" property="photofileId"/>").style.display="none";
document.getElementById("sub2<bean:write name="arraylist" property="photofileId"/>").style.display="none";
}
</script> </td>
</form>
</tr>
</logic:iterate>
</logic:present>
</table> </td>
</tr>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -