?? counter.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 + -