易截截图软件、单文件、免安装、纯绿色、仅160KB

jsp 简单分页

//总记录数
                int count = personDao.getCount();
                //每页显示5条
                int pageSize = 5;
                //当前页
                int currentPage = 1;
                int pageCount = (count + pageSize - 1) / pageSize;
                String _currentPgae = request.getParameter("currentPage");
                if (_currentPgae != null) {
                    currentPage = Integer.parseInt(_currentPgae);
                }
                if (currentPage < 1) {
                    currentPage = 1;
                }
                if (currentPage > pageCount)
                    currentPage = pageCount;
                List list = personDao.getPageList((currentPage - 1) * pageSize,
                        pageSize);
                Iterator it = list.iterator();
 &


相关文档:

JSP 组件上传文件(common fileupload)

第1个上传组件commons-fileupload
=============commons-fileupload ================
common-fileupload组件是apache的一个开源项目之一,可以从http://jakarta.apache.org/commons/fileupload/下载。该组件简单易用,可实现一次上传一个或多个文件,并可限制文件大小。
-下载后解压zip包,将commons-fileupload-1.1. ......

jsp 验证

长度限制JavaScript代码
CODE:
<script> function test() { if(document.a.b.value.length>50) { alert("不能超过50个字符!"); document.a.b.focus(); return
false; } } </script> <form. name=a nsubmit="return test()"> <textarea name="b" cols="40" wrap="VIRTUAL" rows="6"></te ......

JSP学习(一)

JSP基本语法
大部分JSP被一个以“<%” 开头和以“%>”结尾的的标记括在其中。在更新的JSP 1.1规范出台后,就有了与XML兼容的版本。
JSP指令和脚本元素
Directives <%@ directive %>
Declarations <%! declaration %>
Expressions <%= expression %>
Code Fragment/ ......

jsp文件开头path, basePath作用

在JSP中的如果使用 "相对路径"  则有可能会出现问题. 
因为 网页中的 "相对路径" , 他是相对于 "URL请求的地址" 去寻找资源. 
上面这句话是什么意思呢 ? 
举个例子: 
假如我们有一个项目: MyApp 
在该项目下, 有一个jsp文件夹 
该文件夹下包括: 
login.jsp    // ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号