50分求解JSP调用问题
我写了下面一个这样的类,在JSP中是这样调用的 <%=Convert.today() %>
为什么显示不出我想要的结果, 只出现了一个NULL
public class Convert {
public static String today(){
String[] week = new String[] { "天 ", "一 ", "二 ", "三 ", "四 ", "五 ",
"六 " };
Calendar cal = Calendar.getInstance();
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH)+1;
int ndate = cal.get(Calendar.DAY_OF_MONTH);
int day = cal.get(Calendar.DAY_OF_WEEK);
String value = "今天是 " + year + "年 " + month + "月 " + ndate + "日星期 "
+ week[day-1];
System.out.println(value);
return value;
}
}
------解决方案--------------------你的这个Convet有包结构吧
还有看看你的jsp