<%@ page import="java.util.*"%>
<%
if( ${applicationScope.pagenum} == null){
application.setAttribute("pagenum",new Integer(0));
}
%>
<%
Integer num=(Integer)application.getAttribute("pagenum");
application.setAttribute("pagenum",new Integer(num.intValue()+1));
%>
<body>
<%=application.getAttribute("pagenum")%>
</body>这里 IF判断貌似有问题刚上完 表达式的课 不清楚是否可以这样用。。
<%
if( ${applicationScope.pagenum} == null){
application.setAttribute("pagenum",new Integer(0));
}
%>
<%
Integer num=(Integer)application.getAttribute("pagenum");
application.setAttribute("pagenum",new Integer(num.intValue()+1));
%>
<body>
<%=application.getAttribute("pagenum")%>
</body>这里 IF判断貌似有问题刚上完 表达式的课 不清楚是否可以这样用。。
解决方案 »
- 为什么会出现 String index out of range: -13 异常的?
- 大家知道QQ邮箱的多附件上传的功能是用什么空间实现的吗?
- 奇怪问题,望各位能够帮我解决
- 如何协调“美工”与“程序员”的工作呢?
- mysql的JDBC连接字符串中,“useUnicode=true&characterset=gb2312“是什么意思?
- struts输出的过滤问题
- 请问下面说的是什么问题啊!真是晕啊,该怎么解决啊???
- JSP书我看的差不多了,大家能给我推荐一个比较规范的JSP源代码吗,可以下载的, 谢谢
- 我 用struts 做一个页面!表单提交后!说 formbean 的实例是null!而我改成jsp就好了!什么原因啊!急!!高手进·!
- jsp变量不能创建
- 字符格式转换
- 动态生成表格及取值
有知道原因的伐?
有知道原因的伐?
if( application.getAttribute("pagenum") == null){
这样吧。。
<c:set var="pagenum" value="0" scope="application" />
</c:if>
<c:set var="pagenum" value="${applicationScope.pagenum + 1}" scope="application" />
<c:out value="${applicationScope.pagenum + 1}" />
只要把 %TOMCAT_HOME%/webapps/examples/WEB-INF/lib(Tomcat 6.x)、%TOMCAT_HOME%/webapps/jsp-examples/WEB-INF/lib(Tomcat 5.x)下的 jstl.jar、standard.jar 复制到你工程的 WEB-INF/lib 下就可以用了。