• 大小: 346KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-10-22
  • 语言: 其他
  • 标签: jstl  jsp  

资源简介

好久以前的东东,本是尝试搞的。 不过只搞了一半,不是特别完整,但对学习jstl标签应该会有所帮助的吧。 环境:eclipse3.2+tocomcat插件

资源截图

代码片段和文件信息

package com.dkw;

import java.text.SimpleDateFormat;
import java.util.Calendar;
public class Functions {

/**
 * 取系统当前时间,1为长日期,2为短日期,3—8为年、月、日、分、秒
 * @param i            
 * @return String
 */
public static String toNow(int i) {

Calendar c = Calendar.getInstance();
SimpleDateFormat s = new SimpleDateFormat(“yyyy-MM-dd hh:mm:ss“);
SimpleDateFormat s1 = new SimpleDateFormat(“yyyy-MM-dd“);
switch (i) {
case 1:
return s.format(c.getTime());
case 2:
return s1.format(c.getTime());
case 3:
return c.get(Calendar.YEAR) + ““;
case 4:
return c.get(Calendar.MONTH) + ““;
case 5:
return c.get(Calendar.DATE) + ““;
case 6:
return c.get(Calendar.HOUR) + ““;
case 7:
return c.get(Calendar.MINUTE) + ““;
case 8:
return c.get(Calendar.SECOND) + ““;
default:
return s.format(c.getTime());
}
}

/** 
 * 取总纪录数和每页设置的记录条数,计算页数。
 * @param i1
 * @param i2
 * @return String
 */
public static String toMax(int i1 int i2) {

int i = i1 % i2;
int j = i1 / i2;
if (i > 0) {
j = j + 1;
}
return Math.abs(j) + ““;
}

/**
 * 转码IS0转GBK,到应用程序 
 * @param input            
 * @return String
 */
public static String toGBK(String input) {
try {
byte[] bytes = input.getBytes(“ISO8859-1“);
return new String(bytes “GBK“);
} catch (Exception ex) {
}
return input;
}

/**
 * 转码GBK转ISO到mysql数据库
 * @param input
 * @return String
 */
public static String toISO(String input) {
try {
byte[] bytes = input.getBytes(“GBK“);
return new String(bytes “ISO8859-1“);
} catch (Exception ex) {
}
return input;
}


/**
 * 文本换行
 * @param input
 * @return String
 */
public static String toHtml(String input) {

StringBuffer sb = new StringBuffer(input.length());   
        for(int i=0;i              char c=input.charAt(i);   
              if(c==‘\n‘){
               sb.append(“
“);
              }
              else { 
               sb.append(c);
              } 
        }   
        return sb.toString(); 
}

public static String toImageCode(){

return ““;
}


}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        539  2007-07-11 08:36  test\.classpath

     文件          4  2007-05-24 15:20  test\.cvsignore

     文件        439  2007-05-24 15:20  test\.project

     文件        354  2007-05-24 15:20  test\.tomcatplugin

     文件        810  2007-05-24 15:25  test\add.jsp

     文件       1891  2007-05-25 17:45  test\checkadmin.jsp

     文件       1342  2007-05-24 15:25  test\detail.jsp

     文件       1097  2007-05-24 15:25  test\edit.jsp

     文件        171  2007-05-25 17:26  test\foot.jsp

     文件        265  2007-05-25 17:26  test\head.jsp

     文件       2002  2007-05-25 17:26  test\index.jsp

     文件       2564  2007-05-24 15:25  test\index2.jsp

     文件        982  2007-05-25 17:10  test\login.jsp

     文件        595  2007-05-25 17:25  test\page.jsp

     文件       1826  2007-05-24 15:25  test\save.jsp

     文件      19328  2007-05-25 17:46  test\work\org\apache\jsp\checkadmin_jsp.class

     文件      54380  2007-05-25 17:46  test\work\org\apache\jsp\checkadmin_jsp.java

     文件       3599  2007-05-25 17:46  test\work\org\apache\jsp\foot_jsp.class

     文件       2525  2007-05-25 17:46  test\work\org\apache\jsp\foot_jsp.java

     文件       3719  2007-05-25 17:46  test\work\org\apache\jsp\head_jsp.class

     文件       2682  2007-05-25 17:46  test\work\org\apache\jsp\head_jsp.java

     文件       7398  2007-05-25 17:46  test\work\org\apache\jsp\login_jsp.class

     文件       8652  2007-05-25 17:46  test\work\org\apache\jsp\login_jsp.java

     文件          7  2007-05-24 15:20  test\WEB-INF\.cvsignore

     文件       2181  2007-05-25 16:03  test\WEB-INF\web.xml

     文件      10763  2007-05-24 15:25  test\WEB-INF\tlds\c-1_0-rt.tld

     文件      11310  2007-05-24 15:25  test\WEB-INF\tlds\c-1_0.tld

     文件      15999  2007-05-24 15:25  test\WEB-INF\tlds\c.tld

     文件      11409  2007-05-24 15:25  test\WEB-INF\tlds\fmt-1_0-rt.tld

     文件      12580  2007-05-24 15:25  test\WEB-INF\tlds\fmt-1_0.tld

............此处省略41个文件信息

评论

共有 条评论