<%
String[] days = new String[42];
for (int i = 0; i < 42; i++) {
days[i] = "";
} GregorianCalendar currentDay = new GregorianCalendar();
int today = currentDay.get(Calendar.DAY_OF_MONTH);
int month = currentDay.get(Calendar.MONTH);
int year = currentDay.get(Calendar.YEAR);
Calendar thisMonth = Calendar.getInstance();
thisMonth.set(Calendar.MONTH, month);
thisMonth.set(Calendar.YEAR, year);
thisMonth.setFirstDayOfWeek(Calendar.SUNDAY);
thisMonth.set(Calendar.DAY_OF_MONTH, 1);
int firstIndex = thisMonth.get(Calendar.DAY_OF_WEEK) - 1;
int maxIndex = thisMonth.getActualMaximum(Calendar.DAY_OF_MONTH);
for (int i = 0; i < maxIndex; i++) {
days[firstIndex + i] = String.valueOf(i + 1);
}
%>
以上jsp改为jstl要怎么写
解决方案 »
- tomcat不报错,weblogic 报错谁帮我看看
- 这个删除短消息,值无法传过去??? 快疯了,求救啊.....
- 怎么设置java.io.tmpdir或则jfreechart图片不能显示问题
- 急急急!每道题的ABCD选项为一组radio,如何在另外一个页面获取到底选中的radio. 在线等!
- 再线等待!!!!JSP问题
- 招聘人给的问题,大家帮忙看看!!! 在线等待指点...
- 类似sina/sohu等网站是怎么设计的?
- jsp中全局变量i,改代码后不断访问,为什么i会从0自增到2或3后又从0开始自增?求解释!
- apache geronimo 环境下使用httpclient报错
- 求助大神 orz
- 关于java.sql.date和java.util.date的一个老问题
- 竞答:看看如下代码有何错误?
常量可以用c:set
int today = currentDay.get(Calendar.DAY_OF_MONTH);
int month = currentDay.get(Calendar.MONTH);
int year = currentDay.get(Calendar.YEAR);
Calendar thisMonth = Calendar.getInstance();
thisMonth.set(Calendar.MONTH, month);
thisMonth.set(Calendar.YEAR, year);
thisMonth.setFirstDayOfWeek(Calendar.SUNDAY);
thisMonth.set(Calendar.DAY_OF_MONTH, 1);
int firstIndex = thisMonth.get(Calendar.DAY_OF_WEEK) - 1;
int maxIndex = thisMonth.getActualMaximum(Calendar.DAY_OF_MONTH);这一段要怎么改
int today = currentDay.get(Calendar.DAY_OF_MONTH);
int month = currentDay.get(Calendar.MONTH);
int year = currentDay.get(Calendar.YEAR);
Calendar thisMonth = Calendar.getInstance();
thisMonth.set(Calendar.MONTH, month);
thisMonth.set(Calendar.YEAR, year);
thisMonth.setFirstDayOfWeek(Calendar.SUNDAY);
thisMonth.set(Calendar.DAY_OF_MONTH, 1);
int firstIndex = thisMonth.get(Calendar.DAY_OF_WEEK) - 1;
int maxIndex = thisMonth.getActualMaximum(Calendar.DAY_OF_MONTH);这个东西应该在你action中做,而不是在页面!
jstl是基于el表达式的,它的功能没有那么强
如果是ognl的话,还有可能实现!