⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 counter.java

📁 《J2EE专业项目实例开发》源代码
💻 JAVA
字号:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;



public class Counter extends HttpServlet
{     

static int counter;    

public void init(ServletConfig config) throws ServletException      
{     
	super.init(config);     
}

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException     

{            

	response.setContentType("text/html");            

	PrintWriter out=response.getWriter();            

	counter++;            
	out.println("<html>");            
	out.println("<head><title>Money Banks, Inc. -- Welcome Page</title></head>");            
	out.println("<body bgproperties=\"fixed\" bgcolor=\"#CCCCFF\">"); 
 	out.println("<p><b><font><font size=\"6\">Welcome to Money Banks, Inc.</font></font></b></p>");
	out.println("Money Banks, Inc. welcomes you to the site. Money Banks, Inc. is a leading bank dealing and fulfilling the needs of all categories: financial organizations, hospitals, universities, and individuals. The services offered by Money Banks include bank accounts and loans for all needs. You will find complete information regarding various schemes of the bank in this site. In addition, the site enables online banking transactions. You can view your account details and if not an account holder, you can apply for an account online. You'll also find various utilities such as interest calculator and foreign exchange calculator on this site.");
out.println("<p><b><fontsize=\"3\"><a href=\"Home_page.htm\">Click here to continue.</a></font></b></p>");
           
	out.println("You are viewer number   " + String.valueOf(counter)+ "  visting our Web site."+ "\n");            
	out.println("</body></html>");     
}  

public String getServletInfo()     
{            
	return "BasicServlet Information";     
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -