一个完整的门户网站,基于JSP环境下开发的,使用SQL数据库.
源代码在线查看: modify_theme.jsp~81~
int count=0;
up.initialize(pageContext);
try{up.upload();}catch(Exception e){}
Request uprequest=up.getRequest();
int lid=ParamUtils.getIntParameter(uprequest,"fsid");
String action =ParamUtils.getRequestString(uprequest,"action");
BasetableFactory bf=BasetableFactory.getInstance();
boolean falg=false;
if(action==null||"".equals(action)){
return;
}else if("add".equals(action)){
java.util.Random r=new java.util.Random(System.currentTimeMillis()+1);
long longr=r.nextLong();
long longd=System.currentTimeMillis()+longr;
String upname=new Long(longr).toString();
upname=upname.replace('-','_');
File f=up.getFiles().getFile(0);
if(!f.isMissing()){
bf.CreateForum(request,upname);
upname="../upload/forum/"+upname+f.getFileExt();
f.saveAs(upname);
}
response.sendRedirect("manage_link.jsp");
}else if("del".equals(action)&&bf.DeleteLink("WHERE lid="+lid)){
response.sendRedirect("manage_link.jsp");
}else if("modify".equals(action)){
Link l=bf.SearchLink("WHERE lid="+lid);
l.setName(ParamUtils.getRequestString(request,"name"));
l.setUrl(ParamUtils.getRequestString(request,"url"));
response.sendRedirect("manage_link.jsp");
}else{
session.setAttribute("error","在友情链接中操作失败");
response.sendRedirect("error.jsp");
}
%>