1 17 20 21 import java.io.*; 22 import java.text.*; 23 import java.util.*; 24 import javax.servlet.*; 25 import javax.servlet.http.*; 26 27 32 33 public class HelloWorldExample extends HttpServlet { 34 35 36 public void doGet(HttpServletRequest request, 37 HttpServletResponse response) 38 throws IOException, ServletException 39 { 40 ResourceBundle rb = 41 ResourceBundle.getBundle("LocalStrings",request.getLocale()); 42 response.setContentType("text/html"); 43 PrintWriter out = response.getWriter(); 44 45 out.println("<html>"); 46 out.println("<head>"); 47 48 String title = rb.getString("helloworld.title"); 49 50 out.println("<title>" + title + "</title>"); 51 out.println("</head>"); 52 out.println("<body bgcolor=\"white\">"); 53 54 59 63 out.println("<a HREF=\"../helloworld.html\">"); 64 out.println("<img SRC=\"../images/code.gif\" height=24 " + 65 "width=24 align=right border=0 alt=\"view code\"></a>"); 66 out.println("<a HREF=\"../index.html\">"); 67 out.println("<img SRC=\"../images/return.gif\" height=24 " + 68 "width=24 align=right border=0 alt=\"return\"></a>"); 69 out.println("<h1>" + title + "</h1>"); 70 out.println("</body>"); 71 out.println("</html>"); 72 } 73 } 74 75 76 77 | Popular Tags |