用javabean在JSP页面中实现进度条效果
public class TaskBean extends Thread{
public TaskBean(){
}
private int percent=0;
private boolean complete=false;
public synchronized void run() {
while(true){
if(percent>=100){
complete=true;
return;
}
try {
Thread.sleep(1000);
} catch (Exception e) {
System.err.println("TaskBean.run()"+e.getMessage());
}
percent+=10;
}
}
public boolean isComplete(){
return complete;
}
public int getPercent(){
return percent;
}
}
start.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>">
&n
相关文档:
jsp中用javascript将中文Base64转码, Action中再用Base64解码
javascript中使用webtoolkit.base64.js,下载地址http://www.webtoolkit.info/djs/webtoolkit.base64.js
相关介绍 http://www.webtoolkit.info/javascript-base64.html
/**
*
* Base64 encode / decode
* http://www.webtoolkit.info/
*
**/ ......
1.
最基本的乱码问题。
这个乱码问题是最简单的乱码问题。一般新手会出现。就是
页面编码不一致导致的乱码。
<%@ page
language="java" pageEncoding="UTF-8"%>
<%@ page
contentType="text/html;charset=iso8859-1"%>
<html>
<head>
<title> ......
1.ession内的存放的是对象的引用,所以修改内置对象后,不需要重新放置到session中
2.配置Context初始化参数
<Context-param>
<param-name></paran-name>
<param-value></param-value>
<Context-param>
this.getServletContext().getInitParameter(arg0);
--------------------- ......
JSP中结果集显示如下:
<
ww:iterator
value
=
"resultList"
status
=
"status"
>
<
tr
class
=
"<ww:if test="
#status.even"
>
row-even
</
ww:if
> ......