j2eetrainspsys/src/com/util/Info.java
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.util;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Random;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.context.support.WebApplicationContextUtils;
public class Info {
public static Object getDao(HttpServletRequest request,String name)
{
Object ad= (Object) WebApplicationContextUtils
.getRequiredWebApplicationContext(request.getSession().getServletContext()).getBean(name);
return ad;
}
public synchronized static String getID() {
Random random = new Random();
StringBuffer ret = new StringBuffer(20);
String rand = String.valueOf(Math.abs(random.nextInt()));
ret.append(getDateStr());
ret.append(rand.substring(0,6));
return ret.toString();
}
public synchronized static String subStr(String source,int length) {
if(source.length()>length)
{
source=source.substring(0,length)+"...";
}
return source;
}
后面还有 246 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
