我没有运行环境,哪位朋友可以帮我运行贴个结果出来,急需,谢谢了。
各位朋友:
首先声明:我只会ASP,因此,对下面的代码确实不太明白,特别是循环那部分。
我需要一个运行结果,自己又不知道在什么环境下才能运行,麻烦哪位朋友有环境的帮忙贴下,或者给一个简单明白的注释都可以,谢谢了。
/*
* ProgressBar.java
*
* Created on June 20, 2005, 7:11 PM
*/
package ajaxbook.chap4;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
/**
*
* @author nate
* @version
*/
public class ProgressBarServlet extends HttpServlet {
private int counter = 1;
/** Handles the HTTP <code> GET </code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws
ServletException,
IOException {
String task = request.getParameter( "task ");
String res = " ";
if (task.equals( "create ")) {
res = " <key> 1 </key> ";
counter = 1;
}
else {
String percent = " ";
switch (counter) {
case 1: percent = "10 "; break;
case 2: percent = "23 "; break;
case 3: percent = "35 "; break;
case 4: percent = "51 "; break;
case 5: percent = "64 "; break;
&