📄 list.jsp~55~
字号:
<%@page contentType="text/html; charset=GB2312"%>
<%@page import="java.util.*,javax.naming.*,javax.rmi.*"%>
<%@include file="top.jsp"%>
<script type="text/JavaScript" language="JavaScript">
function Onchange()
{
var a=document.form1.type.value;
document.form1.action="list.jsp?type="+a;
document.form1.method="POST";
document.form1.submit();
}
</script>
<html>
<head>
<title>modify</title>
<LINK href="css.css" type="text/css" rel="stylesheet">
</head>
<body bgcolor="#ffffff">
<center>
<form name="form1" id="form1" action="">
<table border="1" bgcolor="#999999" width="770">
<tr>
<td width="30%" align="center" colspan="7">软件类型:
<select name="type" onChange="Onchange()">
<option value="所有软件">所有软件</option>
<%
String type="";
try {
if(request.getParameter("type")!=null){
type=request.getParameter("type");
type=new String(request.getParameter("type").getBytes("iso8859-1"),"gb2312").trim();
//System.out.println("type:"+type+"||"+type.length());
}
Context ic = new InitialContext();
Object obj = ic.lookup("sessionBean");
software.sessionHome home = (software.sessionHome) PortableRemoteObject.narrow(obj, software.sessionHome.class);
software.session b = home.create();
Collection c=b.getTypes();
Iterator i=c.iterator();
while(i.hasNext()){
String dbType=(String)i.next().toString();
dbType=new String(dbType.getBytes("iso8859-1"),"gb2312");
%>
<option value="<%=dbType%>"><%=dbType%></option>
<%
}
}
catch(Exception ex){
}
%>
</td>
</tr>
</table>
</form>
<table border="1" bgcolor="#999999" width="770">
<tr>
<td align="center">软件名称</td><td align="center">上传日期</td><td align="center">大小</td><td align="center">类型</td><td align="center">相关信息</td><td align="center">修改</td><td align="center">删除</td>
</tr>
<%
try {
Context ic = new InitialContext();
Object obj = ic.lookup("sessionBean");
software.sessionHome home = (software.sessionHome) PortableRemoteObject.narrow(obj, software.sessionHome.class);
software.session b = home.create();
Collection c=null;
if(type.equals("all")){
c = b.getAll();
}else{
c=b.getTypeSoftwares(type);
}
Iterator i = c.iterator();
while (i.hasNext()) {
software.softwareRemote s = (software.softwareRemote) i.next();
String str = new String(s.getSoftwareName().trim().getBytes("iso8859-1"), "gb2312");
String id=new String(s.getSoftwareID().getBytes("iso8859-1"), "gb2312");
String dbID = new String(s.getSoftwareID().getBytes("iso8859-1"), "gb2312").trim().substring(0,8);
String dbSoftware = new String(s.getSoftwareName().getBytes("iso8859-1"), "gb2312").trim();
String dbType = new String(s.getSoftwareType().getBytes("iso8859-1"), "gb2312").trim();
String dbInfor = new String(s.getSoftwareInfor().getBytes("iso8859-1"), "gb2312").trim();
String dbSize=new String(s.getSoftwareSize().getBytes("iso8859-1"), "gb2312").trim();
%>
<form action="modify" method="GET">
<tr>
<td>
<%--
href=""中:(引号一定要用,不然对于“TTPlayer 5.0版“,只能得到softwareName=TTPlayer)
--%>
<a href="software.jsp?softwareName=<%=str%>"><%=str%></a>
</td>
<td align="center"><input type="text" name="id" disabled="disabled" value="<%=dbID%>"><input type="hidden" name="id2" value="<%=id%>"></td>
<td><input type="text" name="size" disabled="disabled" value="<%=dbSize%>"></td>
<td>
<input type="text" name=softwareType disabled="disabled" value="<%=dbType%>">
</td>
<td><input type="text" name="softwareInfor" value="<%=dbInfor%>"></td>
<td><input type=submit name=submit value=Edit></td>
<td><input type=submit name=submit value=Delete></td>
</tr>
</form>
<%
}
} catch (Exception ex) {
ex.printStackTrace();
}
%>
</table>
</center>
<br><br><br><br><br><br><br><br><br><br>
</body>
</html>
<%@include file="foot.jsp"%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -